<template>
    <div class="public-detail">
        <el-dialog
                class="public-dialog"
                title="案件信息"
                :visible.sync="publicDialogVisible"
                :modal="false"
                :close-on-click-modal="false"
                :before-close="close">
            <!--案件详情——公共页面——开始-->
            <div class="case-details" v-loading="loading">
                <div class="left-info">
                    <p class="title-name">案件分配</p>
                    <div class="info-content">
                        <div style="height:calc(100% - 300px);overflow-y: auto;">
                            <div class="top-box">
                                <div class="block-item">
                                    <span class="item-name">案件名称：</span>
                                    <span class="item-value">
                                        <el-input v-model="form.eventName" disabled></el-input>
                                    </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">案件来源：</span>
                                    <span class="item-value">
                                        <el-input v-model="form.eventSrcTypeName" disabled></el-input>
                                    </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">案件类别：</span>
                                    <span class="item-value">
                                            <el-input v-model="form.eventTypeName" disabled></el-input>
                                        </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">案件大类：</span>
                                    <span class="item-value">
                                            <el-input v-model="form.eventTypeLv1Name" disabled></el-input>
                                        </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">案件小类：</span>
                                    <span class="item-value">
                                            <el-input v-model="form.eventTypeLv2Name" disabled></el-input>
                                        </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">处置时限：</span>
                                    <span class="item-value">
                                            <el-input v-model="form.time" disabled></el-input>
                                        </span>
                                </div>
                                <div class="line-item">
                                    <span class="item-name">立案条件：</span>
                                    <span class="item-value">
                                        <el-input v-model="form.archivesTypeLeveThree.starConditions"
                                                  disabled></el-input>
                                    </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">所属部门：</span>
                                    <span class="item-value">
                                            <el-input v-model="form.deptName" disabled></el-input>
                                        </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">一级行业：</span>
                                    <span class="item-value">
                                            <el-input v-model="form.industryTypeLv1Name" disabled></el-input>
                                        </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">二级行业：</span>
                                    <span class="item-value">
                                            <el-input v-model="form.industryTypeLv2Name" disabled></el-input>
                                        </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">是否开放景区：</span>
                                    <span class="item-value">
                                        <span v-if="form.isOpenScenic == '0'">
                                            <el-input value="否" disabled></el-input>
                                        </span>
                                        <span v-if="form.isOpenScenic == '1'">
                                            <el-input value="是" disabled></el-input>
                                        </span>
                                    </span>
                                </div>
                                <div class="line-item">
                                    <span class="item-name">发生位置：</span>
                                    <span class="item-value">
                                        <el-input v-model="form.eventAddress" disabled></el-input>
                                    </span>
                                </div>
                                <div class="line-item">
                                    <span class="item-name">案件描述：</span>
                                    <span class="item-value">
                                        <el-input type="textarea" v-model="form.eventDescribe" maxlength="500"
                                                  show-word-limit disabled style="height:100%;"
                                                  class="desc-textarea"></el-input><!--:rows="2"-->
                                    </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">责任主体：</span>
                                    <span class="item-value">
                                                <el-input v-model="form.deptParentName" disabled></el-input>
                                            </span>
                                </div>
                                <div class="block-item">
                                    <span class="item-name">上报电话：</span>
                                    <span class="item-value">
                                        <el-input v-model="form.eventReportPhone" disabled></el-input>
                                    </span>
                                </div>
                                <div  v-if="createUser.role.roleKey == 'bdjgjxy' || createUser.role.roleKey == 'jgczry' || createUser.role.roleKey == 'czry'"></div>
                                <div class="block-item" v-else>
                                    <span class="item-name">上报人姓名：</span>
                                    <span class="item-value">
                                        <el-input v-model="form.eventReportName" disabled></el-input>
                                    </span>
                                </div>

                                <div  v-if="createUser.role.roleKey == 'bdjgjxy' || createUser.role.roleKey == 'jgczry' || createUser.role.roleKey == 'czry'"></div>
                                <div class="block-item" v-else>
                                    <span class="item-name">上报人电话：</span>
                                    <span class="item-value">
                                        <el-input v-model="form.eventCallPhone" disabled></el-input>
                                    </span>
                                </div>

                                <div class="block-box">
                                    <div class="block-item">
                                        <span class="item-name">是否延期：</span>
                                        <span class="item-value">
                                            <el-input v-model="form.archivesTypeLeveThree.isYq" disabled></el-input>
                                        </span>
                                    </div>
                                    <div class="block-item">
                                        <span class="item-name">是否缓办：</span>
                                        <span class="item-value">
                                            <el-input v-model="form.archivesTypeLeveThree.isHb" disabled></el-input>
                                        </span>
                                    </div>
                                </div>
                                <div class="block-box">
                                    <div class="block-item">
                                        <span class="item-name">是否突发：</span>
                                        <span class="item-value">
                                             <el-input v-model="form.archivesTypeLeveThree.isTf" disabled></el-input>
                                        </span>
                                    </div>
                                    <div class="block-item">
                                        <span class="item-name">是否紧急：</span>
                                        <span class="item-value">
                                            <el-input v-model="form.archivesTypeLeveThree.isJj" disabled></el-input>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="map-box" style="position:relative">
                            <div id="myMap"></div>
                            <div class="map-switch" style="position:absolute;top:20px;right:30px" v-if="isPolygonClick">
                                <span class="switch-name">
                                    {{form.industryTypeLv2Name}}
                                </span>
                                <el-switch
                                v-model="isSwithc"
                                active-color="#13ce66"
                                inactive-color="#ff4949"
                                @change='switchChange'>
                                </el-switch>
                            </div>
                        </div>
                    </div>
                    <div class="foot-btn">
                        <el-button v-if="createUser.role.roleKey == 'admin' || createUser.role.roleKey == 'ptjxy'"
                                   type="warning" size="small" icon="el-icon-download" @click="exportCasePDF">导出</el-button>
                        <!--待审批案件-->
                        <div class="btns" v-if="publicData.type == 1">
                            <el-button type="primary" size="small" @click="opendialog()"
                                       v-if="publicData.eventType == 'slow'">缓办审批
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog()"
                                       v-if="publicData.eventType == 'delay'">延期审批
                            </el-button>
                        </div>
                        <!--挂起案件-->
                        <div class="btns" v-if="publicData.type == 2">
                            <el-button type="primary" size="small" @click="opendialog()"
                                       v-if="form.eventDealStatus === '0004'">结束挂起
                            </el-button>
                        </div>
                        <!--案件办理（平台接线员）-->
                        <div class="btns" v-if="publicData.type == 3">
                            <el-button type="warning" size="small" @click="editCase(0)"
                                       v-if="publicData.eventDealStatus === '0101'">编辑
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog('zhuanban')"
                                       v-if="publicData.eventDealStatus === '0101'">转办
                            </el-button>
                            <el-button type="primary" size="small" @click="eventhandleClose()"
                                       v-if="publicData.eventDealStatus === '0101'">销案
                            </el-button>
                            <el-button type="primary" size="small" @click="EventOversee()" v-if="publicData.eventDealStatus !== '0101' && publicData.eventDealStatus !== '0206' && publicData.eventDealStatus !== '0207'
                            && publicData.eventDealStatus !== '0001' && publicData.eventDealStatus !== '0002' && publicData.eventDealStatus !== '0003' ">
                                督办
                            </el-button>
                            <el-button type="primary" size="small" @click="openja3('jiean','other')"
                                       v-if="publicData.eventDealStatus !== '0207' || publicData.eventDealStatus === '0101'">
                                其他方式结案
                            </el-button>
                            <el-button type="primary" size="small" @click="openja3('jiean')"
                                       v-if="publicData.eventDealStatus === '0206'">结案
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog('cxzhuanban')"
                                       v-if="publicData.eventDealStatus === '0206'">重新转办
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog('guaqi')"
                                       v-if="publicData.eventDealStatus !== '0206' && publicData.eventDealStatus !== '0207' && publicData.eventStatus !== '0000'">
                                挂起申请
                            </el-button>
                        </div>
                        <!--案件处理（标段机构接线员）-->
                        <div class="btns" v-if="publicData.type == 4">
                            <!--<el-button type="primary" size="small" @click="opendialog('backoff')" v-if="publicData.eventDealStatus === '0201' || publicData.eventDealStatus === '0202'">回退</el-button>-->
                            <el-button type="primary" size="small" @click="opendialog('backoff')"
                                       v-if="publicData.eventDealStatus === '0201' || publicData.eventDealStatus === '0202'">回退
                            </el-button>
                            <el-button type="primary" size="small" @click="EventOversee()"
                                       v-if="publicData.eventDealStatus === '0203'">督办
                            </el-button>
                            <el-button type="primary" size="small" @click="eventDealwith()"
                                       v-if="publicData.eventDealStatus === '0201'">受理
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog('paiqian')"
                                       v-if="publicData.eventDealStatus === '0202'">派遣
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog('paiqian')"
                                       v-if="publicData.eventDealStatus === '0204'">重新派遣
                            </el-button>
                            <el-button type="primary" size="small" @click="applyHb()"
                                       v-if="publicData.eventDealStatus === '0202' && form.archivesTypeLeveThree.isHb == '是'">
                                缓办申请
                            </el-button>
                            <el-button type="primary" size="small" @click="applyDelay()"
                                       v-if="publicData.eventDealStatus === '0203' && form.archivesTypeLeveThree.isYq == '是'">
                                延期申请
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog('shenhe')"
                                       v-if="publicData.eventDealStatus === '0204'">处置机构审核
                            </el-button>
                        </div>
                        <!--案件处置（监理）-->
                        <div class="btns" v-if="publicData.type == 5">
                            <el-button type="primary" size="small" @click="EventOversee()"
                                       v-if="publicData.eventDealStatus === '0202' || publicData.eventDealStatus === '0203' || publicData.eventDealStatus === '0204'">
                                督办
                            </el-button>
                            <el-button type="primary" size="small" @click="opendialog('shenhe')"
                                       v-if="publicData.eventDealStatus === '0205'">监理审核
                            </el-button>
                            <el-button type="primary" size="small" @click="eventReject1()"
                                       v-if="publicData.eventDealStatus === '0205'">驳回
                            </el-button>
                        </div>

                        <!--评价统计-->
                        <div class="btns" v-if="publicData.type == 6">
                            <el-button type="primary" size="small" @click="cxcz()"
                                       v-if="form.eventEvaluate.evaluateStatus == 1 && form.newEventId == null">重新处置
                            </el-button>
                            <el-button type="primary" size="small" @click="xajDetails()"
                                       v-if="form.eventEvaluate.evaluateStatus == 1 && form.newEventId !== null">新案件详情
                            </el-button>
                        </div>


                        <!--回退-->
                        <div class="btns" v-if="form.eventSrcType == '9' && form.eventStatus == '0100'">
                            <el-button type="primary" size="small" @click="rollback()">回退</el-button>
                        </div>
                        <!--结案-->
                        <div class="btns" v-if="form.eventSrcType == '9' && form.eventStatus == '0206'">
                            <el-button type="primary" size="small" @click="testFinish()">结案</el-button>
                        </div>

                        <div class="btns">
                            <el-button type="primary" size="small" @click="toStreetView">街景</el-button>
                        </div>

                    </div>
                </div>
                <div class="right-process">
                    <el-timeline>
                        <el-timeline-item
                                class="timelineitem"
                                v-for="(item,i) in eventLogList"
                                :key="i"
                                :timestamp="item.typeName + ' '  + item.createTime" placement="top"
                                :id="'title' + item.typeCode">
                            <el-card>
                                <div class="timeline_desc">
                                    <h4>{{item.describe}}</h4>
                                    <p>{{item.remark}}</p>
                                </div>
                                <!--<li class="timeline_images" :id="'timeline_images' + i" ></li>-->
                                <div v-if="bigArr['arr' + i].length>0 && smallArr['arr' + i].length>0">
                                    <viewer :images="smallArr['arr' + i]" class="timeline_images">
                                        <li class="images_item" v-for="(itemone,indexone) in smallArr['arr' + i]"
                                            :key="indexone">
                                            <img :data-original="url + bigArr['arr' + i][indexone]" :src="url + itemone"
                                                 alt="">
                                        </li>
                                    </viewer>
                                </div>
                                <div v-if="bigArr['arr' + i].length>0 && smallArr['arr' + i].length===0">
                                    <viewer :images="bigArr['arr' + i]" class="timeline_images">
                                        <li class="images_item" v-for="(itemone,indexone) in bigArr['arr' + i]"
                                            :key="indexone">
                                            <img :data-original="url + itemone" :src="url + itemone" alt="">
                                        </li>
                                    </viewer>
                                </div>

                            </el-card>
                        </el-timeline-item>
                    </el-timeline>
                </div>
            </div>
            <!--案件详情——公共页面——结束-->
        </el-dialog>

        <!--编辑选择发生位置——地图标点-->
        <el-dialog
                class="every-dialog select-address"
                title="选择发生位置"
                :visible.sync="addressDialog"
                v-if="addressDialog"
                :before-close="closeAddressDialog"
                width="40%">
            <div class="select-address-content">
                <p class="now-address">当前位置：{{copyEditAddress.eventAddress}}</p>
                <div id="addressMap"></div>
            </div>
            <div class="dialog-footer">
                <el-button type="primary" @click="confirmAddress()" :disabled="editDialogloading">保 存</el-button>
                <el-button @click="closeAddressDialog">取 消</el-button>
            </div>
        </el-dialog>

        <!--编辑案件-->
        <el-dialog
                class="every-dialog"
                title="编辑案件"
                :visible.sync="editDialogVisible"
                v-if="editDialogVisible"
                :close-on-click-modal="false"
                width="800px">
            <div class="edit-dialog-content" v-loading="editDialogloading">
                <div class="block-item">
                    <span class="item-name">案件名称：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.eventName" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name"><i>*</i>案件类别：</span>
                    <span class="item-value">
                        <el-select v-model="editForm.eventType" @change="getCaseBigClass(true)">
                            <el-option v-for="item in caseTypeData" :value="item.code" :label="item.name"
                                       :key="item.id"></el-option>
                        </el-select>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name"><i>*</i>案件大类：</span>
                    <span class="item-value">
                        <el-select v-model="editForm.eventTypeLv1" @change="getCaseSmallClass(true)"
                                   :disabled="editForm.eventType === ''">
                            <el-option v-for="item in caseBigClassData" :value="item.id" :label="item.name"
                                       :key="item.id"></el-option>
                        </el-select>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name"><i>*</i>案件小类：</span>
                    <span class="item-value">
                        <el-select v-model="editForm.eventTypeLv2" :disabled="editForm.eventTypeLv1 === ''"
                                   @change="getCaseCondition(true)">
                            <el-option v-for="item in caseSmallClassData" :value="item.id" :label="item.name"
                                       :key="item.id"></el-option>
                        </el-select>
                    </span>
                </div>
                <div class="line-item">
                    <span class="item-name"><i>*</i>立案条件：</span>
                    <span class="item-value">
                        <el-select v-model="editForm.eventTypeLv3" :disabled="editForm.eventTypeLv2 === ''"
                                   @change="getOtherInfo">
                            <el-option v-for="item in caseConditionData" :value="item.id" :label="item.name"
                                       :key="item.id"></el-option>
                        </el-select>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">责任主体：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.deptParentName" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">所属部门：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.deptName" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">一级行业：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.industryTypeLv1Name" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">二级行业：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.industryTypeLv2Name" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">是否延期：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.archivesTypeLeveThree.isYq" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">是否缓办：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.archivesTypeLeveThree.isHb" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">是否突发：</span>
                    <span class="item-value">
                         <el-input v-model="editForm.archivesTypeLeveThree.isTf" disabled></el-input>
                    </span>
                </div>
                <div class="block-item">
                    <span class="item-name">是否紧急：</span>
                    <span class="item-value">
                        <el-input v-model="editForm.archivesTypeLeveThree.isJj" disabled></el-input>
                    </span>
                </div>
                <div class="line-item">
                    <span class="item-name"><i>*</i>发生位置：</span>
                    <span class="item-value happen-address">
                        <el-input v-model="editForm.eventAddress" disabled></el-input>
                        <el-tooltip class="item" effect="dark" content="选择位置" placement="top-start">
                            <img src="../../assets/image/address.png" alt="选择位置" @click="selectAddress">
                        </el-tooltip>
                    </span>
                </div>
                <div class="line-item">
                    <span class="item-name"><i>*</i>是否开放景区：</span>
                    <span class="item-value">
                        <el-select v-model="editForm.isOpenScenic" placeholder="">
                            <el-option
                                    v-for="(item,index) in isOpenScenicData"
                                    :key="index"
                                    :label="item.name"
                                    :value="item.code">
                            </el-option>
                        </el-select>
                    </span>
                </div>
                <div class="line-item">
                    <span class="item-name"><i>*</i>案件描述：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="2" v-model="editForm.eventDescribe" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button type="primary" @click="editCase(1)" :disabled="editDialogloading">保 存</el-button>
                <el-button @click="editDialogVisible = false">取 消</el-button>
            </div>
        </el-dialog>

        <!--其他方式结案-->
        <el-dialog
                class="every-dialog"
                :title="title"
                :visible.sync="dialogVisibleja3"
                v-if="dialogVisibleja3"
                :close-on-click-modal="false"
                :width="dialogWidth">
            <!--案件结案-->
            <div class="dialog-content"
                 v-if="publicData.type == 3 && publicData.eventDealStatus !== '0207' || publicData.eventDealStatus === '0101'">
                <div v-if="closeCaseType === 0">
                    <div class="line-item">
                        <span class="item-name">结案原因：</span>
                        <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="ja.remark" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                    </div>
                </div>
                <div v-if="closeCaseType === 1">
                    <div class="line-item">
                        <span class="item-name"><i>*</i>原因：</span>
                        <span class="item-value">
                           <el-select v-model="otherSelect" @change="handleChange">
                               <el-option v-for="item in otherReasonData" :value="item.id" :label="item.name"
                                          :key="item.id"></el-option>
                           </el-select>
                        </span>
                    </div>
                    <div class="line-item">
                        <span class="item-name">其他方式结案意见：</span>
                        <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="ja.remark" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                    </div>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisibleja3 = false">取 消</el-button>
                <el-button type="primary" @click="saveja3()">确 定</el-button>
            </div>
        </el-dialog>

        <!--案件结束挂起弹出层-->
        <el-dialog
                class="every-dialog"
                :title="title"
                :visible.sync="dialogVisible"
                v-if="dialogVisible"
                :close-on-click-modal="false"
                :width="dialogWidth">
            <!--挂起案件-->
            <div class="dialog-content" v-if="publicData.type == 2">
                <div class="line-item">
                    <span class="item-name">备注：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="remark" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <!--待审批案件-->
            <div class="dialog-content" v-if="publicData.type == 1">
                <div class="line-item line-itemW">
                    <span class="item-name"><i>*</i>审批状态：</span>
                    <span class="item-value">
                            <el-select v-model="pendingApproval.auditStatus" size="small">
                                <el-option label="通过" value="1"></el-option>
                                <el-option label="不通过" value="2"></el-option>
                            </el-select>
                        </span>
                </div>
                <div class="line-item">
                    <span class="item-name"><i>*</i>审批意见：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容"
                                      v-model="pendingApproval.auditDetails" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <!--案件转办-->
            <div class="dialog-content" v-if="publicData.type == 3 && publicData.eventDealStatus === '0101'">
                <div class="organization_body">
                    <div v-if="transfer.organizationData.length != 0">
                        <p class="organization_body_p" style="margin-bottom:10px">推荐机构</p>
                        <p class="organization_body_p" style="margin:10px 10px 0 10px;text-align:left;line-height: 25px;">{{transfer.organizationData[0].name}}</p>
                    </div>
                    <p class="organization_body_notp" v-else>暂无推荐机构</p>
                </div>
                <div class="line-item line-itemW">
                    <span class="item-name" style="text-align: left;width: 1.2rem;"><i>*</i>转办机构：</span>
                    <span class="item-value">
                        <el-select v-model="transfer.organizationid" size="small">
                            <el-option
                                v-for="(item,index) in transfer.organizationData"
                                :key="index"
                                :label="item.name"
                                :value="item.code">
                            </el-option>
                        </el-select>
                    </span>
                </div>
                <div class="line-item">
                    <span class="item-name" style="text-align: left;padding-left: 0.125rem;width: 1.2rem;">转办描述：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="transfer.remark"
                                      maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>

            <!--案件派遣-->
            <div class="dialog-content"
                 v-if="publicData.type == 4 && publicData.eventDealStatus === '0202' || publicData.eventDealStatus === '0204'">
                <div class="line-item line-itemW">
                    <div class="item-value paiqian">
                        <div class="paiqianTop" v-if="dispatch.sendTargetIdData.length == 0 ">
                            <p class="p1" style="color:#3573ae;">暂无派遣人员</p>
                        </div>
                        <div class="paiqianTop" v-if="!dispatch.default && dispatch.sendTargetIdData.length != 0">
                            <p class="p1" style="color:#3573ae;">暂无推荐派遣人</p>
                        </div>
                        <div class="selectPerson" id="hsxjy" v-if="dispatch.default">
                            <div class="InspectorMes">
                                <span class="name" style="color:#3573ae;font-weight: 600;">推荐派遣人:{{dispatch.selectPqcumsum}}</span>
                            </div>
                        </div>
                        <div class="Inspectors">
                            <div class="xjyDiv" id="xjyDiv">
                                <div class="dinp1" v-for="(item,index) in dispatch.sendTargetIdData" :key="item.index">
                                    <el-radio v-model="dispatch.sendTargetId" :label="item.userid"
                                            @change="radioChange()" style="width:100%;line-height:24px;height:30px;display: flex;justify-content: center;align-items: center;">
                                        <span>{{item.nickname}}</span>
                                        <span><img src="../../assets/image/paiqianphone.png" alt=""
                                                style="width: 15px;position: absolute;top: 8px;left: 267px;">{{item.phonenumber}}</span>
                                    </el-radio>
                                </div>
                            </div>
                        </div>
                        <!-- <div class="paiqianTop" v-if="dispatch.sendTargetId === ''">
                            <p class="p1">暂无派遣人员</p>
                            <p class="p2">请选择要派遣的人员</p>
                            <img src="../../assets/image/paiqianopen1.png" alt="">
                        </div>
                        <div class="selectPerson" id="hsxjy" v-if="dispatch.sendTargetId != ''">
                            <div class="InspectorMes">
                                <img src="../../assets/image/name.png">
                                <span class="name">{{dispatch.selectPq}}</span>
                                <span class="break">

                                </span>
                                <img src="../../assets/image/paiqianphone.png">
                                <span class="phone">{{dispatch.selectPhone}}</span>
                            </div>
                        </div>
                        <div class="Inspectors">
                            <div class="tips"><span>派遣人员</span></div>
                            <div class="xjyDiv" id="xjyDiv">
                                <div class="dinp1" v-for="(item,index) in dispatch.sendTargetIdData" :key="item.index">
                                    <el-radio v-model="dispatch.sendTargetId" :label="item.userId"
                                              @change="radioChange()" style="width:100%;line-height:0.3rem;height:0.375rem;">
                                        <span>{{item.nickName}}</span>
                                        <span><img src="../../assets/image/paiqianphone.png" alt=""
                                                   style="width: 16px;">{{item.phonenumber}}</span>
                                    </el-radio>
                                </div>
                            </div>
                        </div> -->
                    </div>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="saveEventPendEnd()">确 定</el-button>
            </div>
        </el-dialog>
        
        <!--案件回退-->
        <el-dialog
                class="every-dialog"
                title="案件回退"
                :visible.sync="dialogVisible2"
                v-if="dialogVisible2"
                :close-on-click-modal="false"
                width="600px">
            <!--案件督办-->
            <div class="dialog-content"
                 v-if="publicData.type == 4 && publicData.eventDealStatus === '0201' || publicData.eventDealStatus === '0202'">
                <div class="line-item">
                    <span class="item-name"><i>*</i>回退描述：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="backoff.eventDescribe"
                                      maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisible2 = false">取 消</el-button>
                <el-button type="primary" @click="eventbackoff()">确 定</el-button>
            </div>
        </el-dialog>

        <!--案件督办-->
        <el-dialog
                class="every-dialog"
                :title="title"
                :visible.sync="dialogVisible1"
                v-if="dialogVisible1"
                :close-on-click-modal="false"
                width="600px">
            <!--案件督办-->
            <div class="dialog-content" v-if="publicData.type == 3 || publicData.type == 4 || publicData.type == 5">
                <div class="line-item">
                    <span class="item-name"><i>*</i>督办意见：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="eventOversee.contents"
                                      maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisible1 = false">取 消</el-button>
                <el-button type="primary" @click="saveeventOversee()">确 定</el-button>
            </div>
        </el-dialog>

        <!--案件驳回-->
        <el-dialog
                class="every-dialog"
                title="案件驳回"
                :visible.sync="dialogVisiblebh"
                v-if="dialogVisiblebh"
                :close-on-click-modal="false"
                width="600px">
            <!--案件驳回-->
            <div class="dialog-content" v-if="publicData.type == 5 && publicData.eventDealStatus === '0205'">
                <div class="line-item">
                    <span class="item-name"><i>*</i>驳回备注：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="eventReject.remark"
                                      maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisiblebh = false">取 消</el-button>
                <el-button type="primary" @click="saveeventReject()">确 定</el-button>
            </div>
        </el-dialog>

        <!--案件销案-->
        <el-dialog
                class="every-dialog"
                title="案件销案"
                :visible.sync="dialogVisiblexa"
                v-if="dialogVisiblexa"
                :close-on-click-modal="false"
                width="600px">
            <!--案件驳回-->
            <div class="dialog-content" v-loading="dialogLoading">
                <div class="line-item">
                    <span class="item-name"><i>*</i>销案备注：</span>
                    <span class="item-value">
                        <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="cancellation.remark"
                                  maxlength="500"
                                  show-word-limit></el-input>
                    </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisiblexa = false">取 消</el-button>
                <el-button type="primary" @click="saveCancellation()" :disabled="dialogLoading">确 定</el-button>
            </div>
        </el-dialog>

        <!--案件办理的挂起-->
        <el-dialog
                class="every-dialog"
                title="案件挂起申请"
                :visible.sync="dialogVisiblegq"
                v-if="dialogVisiblegq"
                :close-on-click-modal="false"
                width="600px">
            <!--案件办理的挂起-->
            <div class="dialog-content" v-loading="dialogLoading">
                <div class="line-item line-itemW">
                    <span class="item-name"><i>*</i>挂起原因：</span>
                    <span class="item-value">
                            <el-select v-model="blgq.pendReason" size="small">
                                 <el-option
                                         v-for="(item,index) in pendReasonData"
                                         :key="index"
                                         :label="item.name"
                                         :value="item.code">
                                 </el-option>
                            </el-select>
                        </span>
                </div>
                <div class="line-item">
                    <span class="item-name">备注：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="blgq.pendRemark"
                                      maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisiblegq = false">取 消</el-button>
                <el-button type="primary" @click="savegq()" :disabled="dialogLoading">确 定</el-button>
            </div>
        </el-dialog>

        <!--处置机构审核-->
        <el-dialog
                class="every-dialog"
                title="案件审核"
                :visible.sync="dialogVisibleczjg"
                v-if="dialogVisibleczjg"
                :close-on-click-modal="false"
                width="600px">
            <!--案件办理的挂起-->
            <div class="dialog-content">
                <div class="line-item">
                    <span class="item-name">审核备注：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="czjgremark" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisibleczjg = false">取 消</el-button>
                <el-button type="primary" @click="eventDealwith()" :disabled="dialogLoading">确 定</el-button>
            </div>
        </el-dialog>

        <!--监理审核-->
        <el-dialog
                class="every-dialog"
                title="案件审核"
                :visible.sync="dialogVisiblejl"
                v-if="dialogVisiblejl"
                :close-on-click-modal="false"
                width="600px">
            <!--案件办理的挂起-->
            <div class="dialog-content">
                <div class="line-item">
                    <span class="item-name">审核备注：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="jlremark" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisiblejl = false">取 消</el-button>
                <el-button type="primary" @click="eventDealwith()" :disabled="dialogLoading">确 定</el-button>
            </div>
        </el-dialog>

        <!--延期申请-->
        <el-dialog
                class="every-dialog"
                title="案件延期申请"
                :visible.sync="dialogVisibleyq"
                v-if="dialogVisibleyq"
                :close-on-click-modal="false"
                width="600px">
            <!--案件办理的挂起-->
            <div class="dialog-content">
                <div class="line-item">
                    <span class="item-name"><i>*</i>延期原因：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="yqreason" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisibleyq = false">取 消</el-button>
                <el-button type="primary" @click="saveyq()" :disabled="dialogLoading">确 定</el-button>
            </div>
        </el-dialog>

        <!--缓办申请-->
        <el-dialog
                title="案件缓办申请"
                class="every-dialog upload-image"
                :visible.sync="dialogVisiblehb"
                v-if="dialogVisiblehb"
                :close-on-click-modal="false"
                width="630px">
            <!--案件办理的挂起-->
            <div class="dialog-content">
                <div class="line-item">
                    <span class="item-name"><i>*</i>缓办描述：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="hbreason" maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
                <div class="line-item">
                    <span class="item-name"><i>*</i>图片上传：</span>
                    <el-upload
                            action="#"
                            list-type="picture-card"
                            :auto-upload="false"
                            :file-list="fileList"
                            :on-change="uploadChange"
                            style="flex:1;">
                        <i slot="default" class="el-icon-plus"></i>
                        <div slot="file" slot-scope="{file}">
                            <img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
                            <span class="el-upload-list__item-actions">
                            <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
                                <i class="el-icon-zoom-in"></i>
                            </span>
                            <span class="el-upload-list__item-delete" @click="handleRemove(file)">
                                <i class="el-icon-delete"></i>
                            </span>
                        </span>
                        </div>
                    </el-upload>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisiblehb = false">取 消</el-button>
                <el-button type="primary" @click="savehb()" :disabled="dialogLoading">确 定</el-button>
            </div>
        </el-dialog>
        <el-dialog title="查看图片" :visible.sync="viewImageDialog" v-if="viewImageDialog"
                   :close-on-click-modal="false" class="bigImg every-dialog">
            <img width="100%" :src="dialogImageUrl" alt="">
        </el-dialog>

        <!--案件转办-->
        <el-dialog
                class="every-dialog"
                title="案件重新转办"
                :visible.sync="dialogVisiblecxzb"
                v-if="dialogVisiblecxzb"
                :close-on-click-modal="false"
                :width="dialogWidth">
            <div class="dialog-content" v-if="publicData.type == 3 && publicData.eventDealStatus === '0206'">
                <div class="organization_body">
                    <div v-if="transfer.organizationData.length != 0">
                        <p class="organization_body_p" style="margin-bottom:10px">推荐机构</p>
                        <p class="organization_body_p" style="margin:10px 10px 0 10px;text-align:left;line-height: 25px;">{{transfer.organizationData[0].name}}</p>
                    </div>
                    <p class="organization_body_notp" v-else>暂无推荐机构</p>
                </div>
                <div class="line-item line-itemW">
                    <span class="item-name"><i>*</i>转办机构：</span>
                    <span class="item-value">
                        <el-select v-model="transfer.organizationid" size="small">
                             <el-option
                                     v-for="(item,index) in transfer.organizationData"
                                     :key="index"
                                     :label="item.name"
                                     :value="item.code">
                             </el-option>
                        </el-select>
                    </span>
                </div>
                <div class="line-item">
                    <span class="item-name">转办描述：</span>
                    <span class="item-value">
                        <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="transfer.remark"
                                  maxlength="500"
                                  show-word-limit></el-input>
                    </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="dialogVisiblecxzb = false">取 消</el-button>
                <el-button type="primary" @click="savecxzb()" :disabled="dialogLoading">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 案件回退 -->
        <el-dialog
                class="every-dialog"
                title="案件回退"
                :visible.sync="rollbackdialogLoading"
                v-if="rollbackdialogLoading"
                :close-on-click-modal="false"
                width="600px">
            <!--案件督办-->
            <div class="dialog-content"
                 v-if="form.eventSrcType == '9' && form.eventStatus == '0100'">
                <div class="line-item">
                    <span class="item-name"><i>*</i>回退描述：</span>
                    <span class="item-value">
                            <el-input type="textarea" :rows="4" placeholder="请输入回退内容" v-model="rollbackeventDescribe"
                                      maxlength="500"
                                      show-word-limit></el-input>
                        </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="rollbackdialogLoading = false">取 消</el-button>
                <el-button type="primary" @click="rollbackbackoff()">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 结案 -->
        <el-dialog
            class="every-dialog"
            title="结案"
            :visible.sync="testFinishDialogVisible"
            v-if="testFinishDialogVisible"
            :close-on-click-modal="false"
            :width="dialogWidth">
            <!--案件结案-->
            <div class="dialog-content"
                 v-if="form.eventSrcType == '9' && form.eventStatus == '0206'">
                <div class="line-item">
                    <span class="item-name">结案原因：</span>
                    <span class="item-value">
                        <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="testFinishremark" maxlength="500"
                                    show-word-limit></el-input>
                    </span>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button @click="testFinishDialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="testFinishoff()">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    import Cookies from 'js-cookie'
    import {
        getEventInfoByEventId,
        getEventLogList,
        saveEventPendEnd,
        updateEventSlow,
        updateEventDelay,
        saveCirculationEvent
    } from '@/api/case/caseQuery'
    import {
        getOrganization, handleshunt, eventThreeAccept, eventThreeCzry, eventThreeSend, eventThreeExamine,
        JLeventThreeExamine, handleover, updateDelFlagById, eventOversee, eventReject, caseCancellation, otherCloseData,
        otherCloseCase, pendReason, saveEventPend, checkDelay, insertEventDelay, checkHb, saveEventSlow,
        submitRegisterInfo, getQJData, getCaseCondition, getOtherInfo, editRegisterInfo, getkfjq,
        getAllBDJGBj, getOnlyBDJGBj, exportCasePDF,getTypelv2MapData,getFallBack,getTestFinish
    } from '@/api/case/caseOperate'
    import {getcaseType, getcategoryName, getsubclassName} from '@/api/configure/configure'
    import Viewer from 'viewerjs'
    import 'viewerjs/dist/viewer.css'

    export default {
        name: 'PublicDialog',
        props: ['publicDialogVisible','isPolygonClick'],
        data() {
            return {
                testFinishDialogVisible:false,
                testFinishremark:'',
                getotherCzry:[],
                getbestCzry:[],
                // 页面加载
                loading: false,
                //案件id
                eventId: '',
                // 登录的用户信息
                createUser: JSON.parse(localStorage.getItem('userInfo')),
                // 表单数据
                form: {
                    //判断是从哪个页面进来的
                    type: null,//0-全部案件详情，1-待审批，2-案件挂起，3-案件办理（转办），4-案件处理（受理、审核），5-案件处置（审核），6-评价统计
                    //案件名称
                    eventName: '',
                    // 案件来源
                    eventSrcType: '',
                    eventSrcTypeName: '',
                    // 上报电话
                    eventReportPhone: '',
                    // 上报人
                    eventReportName: '',
                    // 上报人电话
                    eventCallPhone: '',
                    // 案件类别
                    eventType: '',
                    eventTypeName: '',
                    // 案件大类
                    eventTypeLv1: '',
                    eventTypeLv1Name: '',
                    // 案件小类
                    eventTypeLv2: '',
                    eventTypeLv2Name: '',
                    // 处置时限
                    time: '',
                    // 责任主体
                    deptParentCode: '',
                    deptParentName: '',
                    // 所属部门
                    deptCode: '',
                    deptName: '',
                    // 一级行业
                    industryTypeLv1: '',
                    industryTypeLv1Name: '',
                    // 二级行业
                    industryTypeLv2: '',
                    industryTypeLv2Name: '',
                    archivesTypeLeveThree: {
                        // 立案条件
                        starConditions: '',
                        // 是否延期
                        isYq: '',
                        // 是否缓办
                        isHb: '',
                        // 是否突发
                        isTf: '',
                        // 是否紧急
                        isJj: '',
                    },

                    // 发生位置
                    eventAddress: '',
                    // 是否开放景区
                    isOpenScenic: '',
                    // 发生位置X坐标
                    gdx: '',
                    // 发生位置Y坐标
                    gdy: '',
                    // 案件描述
                    eventDescribe: '',
                    // 案件级别（目前没有）
                    eventLevel: 0,
                    eventEvaluate: {
                        evaluateStatus: "1",
                        evaluateTime: "2020-10-12T15:56:12.000+0800",
                    },
                    newEventId: ''
                },
                //案件日志数据
                eventLogList: [],
                //结束挂起弹出层
                dialogVisible: false,
                //弹出层宽度
                dialogWidth: '600px',
                //弹出层的title
                title: '',
                //结束挂起备注
                remark: '',
                //待审批案件
                pendingApproval: {
                    //待审批详情页的按钮要根据案件类别出现
                    eventType: null,
                    //审批意见
                    auditDetails: '',
                    //审批状态
                    auditStatus: ''
                },
                //案件转办
                transfer: {
                    organizationData: [],//机构
                    organizationid: '',//机构编码
                    organizationPers: [],//处置人员
                    organizationPersId: '',//处置人员编码
                    
                    remark: '',//转办描述
                    //已选派遣人员的信息
                    selectPhone: '',
                    selectPq: '',
                },
                //案件督办
                dialogVisible1: false,
                eventOversee: {
                    contents: '',
                },
                //案件回退
                dialogVisible2: false,
                backoff: {
                    eventDescribe: '',//回退描述
                },
                //案件派遣
                dispatch: {
                    sendTargetId: '',
                    sendTargetIdData: [],
                    //已选派遣人员的信息
                    selectPhone: '',
                    selectPq: '',
                    default:false,
                    selectPqcumsum:''
                },
                //结案
                ja: {
                    remark: ''
                },
                //案件驳回
                dialogVisiblebh: false,
                eventReject: {
                    remark: ''
                },

                // 案件销案
                // 弹出层绑定参数
                dialogVisiblexa: false,
                // 销案备注
                cancellation: {
                    remark: ''
                },
                //案件办理的挂起
                dialogVisiblegq: false,
                blgq: {
                    params: {
                        reason: ''
                    },
                    pendReason: '',
                    pendRemark: ''
                },
                // 弹出层加载
                dialogLoading: false,
                // 回退弹框
                rollbackdialogLoading:false,
                // 结案方式
                closeCaseType: 0, // 0——正常结案；1——其他方式结案
                // 其他方式结案下拉参数
                otherSelect: '',
                // 其他方式结案原因下拉数据
                otherReasonData: [],
                //办理的挂起原因数据
                pendReasonData: [],
                //处置机构审核备注
                czjgremark: '',
                dialogVisibleczjg: false,
                //监理审核备注
                jlremark: '',
                dialogVisiblejl: false,
                //延期申请
                dialogVisibleyq: false,
                yqreason: '',
                //缓办申请
                dialogVisiblehb: false,
                hbreason: '',
                // 查看图片弹出层
                viewImageDialog: false,
                // 上传的文件列表
                fileList: [],
                // 获取的图片数据
                imageData: [],
                // 单个图片查看地址
                dialogImageUrl: '',
                url: process.env.VUE_APP_PROD_API,
                // 重新转办
                dialogVisiblecxzb: false,
                // 公共参数
                publicData: {
                    type: null,
                    eventType: null,
                },
                str: {},
                bigArr: {},
                smallArr: {},
                dialogVisibleja3: false,
                // 曲江边界数据
                qjBoundaryData: [],
                // 高德地图
                GDMap: null,
                infoWindow:null,
                infoWindowText:'',
                isSwithc:false,
                // 对应行业类别特殊图层地图数据
                Typelv2MapData:[],
                // 编辑案件弹出层绑定参数
                editDialogVisible: false,
                // 编辑案件弹出层加载
                editDialogloading: false,
                // 编辑案件的form表单数据
                editForm: {
                    // 案件ID
                    eventId: '',
                    //案件名称
                    eventName: '',
                    // 案件类别
                    eventType: '',
                    // 案件大类
                    eventTypeLv1: '',
                    // 案件小类
                    eventTypeLv2: '',
                    // 立案条件
                    eventTypeLv3: '',
                    // 责任主体
                    deptParentCode: '',
                    deptParentName: '',
                    // 所属部门
                    deptCode: '',
                    deptName: '',
                    // 一级行业
                    industryTypeLv1: '',
                    industryTypeLv1Name: '',
                    // 二级行业
                    industryTypeLv2: '',
                    industryTypeLv2Name: '',
                    archivesTypeLeveThree: {
                        // 是否延期
                        isYq: '',
                        // 是否缓办
                        isHb: '',
                        // 是否突发
                        isTf: '',
                        // 是否紧急
                        isJj: '',
                    },
                    // 发生位置
                    eventAddress: '',
                    // 发生位置X坐标
                    gdx: '',
                    // 发生位置Y坐标
                    gdy: '',
                    // 是否开放景区
                    isOpenScenic: '',
                    // 案件描述
                    eventDescribe: '',
                },
                // 案件类别下拉数据
                caseTypeData: [],
                // 案件大类下拉数据
                caseBigClassData: [],
                // 案件小类下拉数据
                caseSmallClassData: [],
                // 立案条件下拉数据
                caseConditionData: [],
                // 根据立案条件查询责任主体、部门、一级行业、二级行业等信息
                allOtherInfo: {},
                //查看地图弹出层
                dialogVisibleLookMap: false,
                // 是否开放性景区数据
                isOpenScenicData: [],
                // 编辑——发生位置弹出层
                addressDialog: false,
                // 地图搜索框绑定参数
                searchInput: '',
                // 编辑案件——发生位置选择
                copyEditAddress: {
                    // 发生位置
                    eventAddress: '',
                    // 发生位置X坐标
                    gdx: '',
                    // 发生位置Y坐标
                    gdy: '',
                },
                rollbackeventDescribe:''
            }
        },
        computed: {
            timelineImages() {
                for (let i = 0; i < this.eventLogList.length; i++) {
                    if (this.eventLogList[i].images.length > 0) {
                        return this.eventLogList[i].images;
                    } else {
                        return [];
                    }
                }
            },
            visitedViews() {
                return this.$store.state.tagsView.visitedViews
            },
        },
        methods: {
            testFinish(){
                this.testFinishDialogVisible = true
            },
            testFinishoff(){
                if(this.testFinishremark = ''){
                    this.$message.error('请填写结案原因');
                    return false
                }
                getTestFinish({eventId:this.eventId,opinion:this.testFinishremark}).then((res)=>{
                    this.loading = true;
                    if(res.code == 200){
                        this.$message.success('结案成功');
                        this.loading = false;
                        this.testFinishDialogVisible = false
                        this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                    }
                }).catch((error) => {
                    this.loading = false;
                    console.log(error, 'getQJData')
                })
                handleover({eventId:this.eventId,remark:this.testFinishremark}).then((res)=>{
                    console.log('结案成功')
                })
            },
            closeAddressDialog(){
                this.initMap('myMap')
                this.addressDialog = false
            },
            //选择派遣人员radio事件
            radioChange() {
                for (let i = 0; i < this.dispatch.sendTargetIdData.length; i++) {
                    if (this.dispatch.sendTargetIdData[i].userid === this.dispatch.sendTargetId) {
                        this.dispatch.selectPq = this.dispatch.sendTargetIdData[i].nickname;
                        this.dispatch.selectPhone = this.dispatch.sendTargetIdData[i].phonenumber;
                    }
                }
            },
            /**
             * Description:获取曲江边界数据
             * Author:ybt
             * Date:2020/11/5
             */
            getQJData() {
                getQJData({}).then((res) => {
                    this.qjBoundaryData = JSON.parse(res.msg);
                }).catch((error) => {
                    console.log(error, 'getQJData')
                })
            },
            // 初始化事件
            initPublicData(data) {
                this.publicData = data;
                console.log(this.publicData)
                this.eventId = this.publicData.eventId;
                // 向消息推送发送数据
                this.$lsbridge.send('eventId', {eventId: this.eventId});
                this.form.type = this.publicData.type;
                this.pendingApproval.eventType = this.publicData.eventType;
                // 获取曲江边界数据
                this.getQJData();
                // 获取案件详情数据
                this.getEventInfo();
                // 获取案件日志
                this.getEventLogList();
                // console.log(data)
            },
            close() {
                this.isSwithc = false
                this.infoWindowText = ''
                this.Typelv2MapData = []
                this.$emit('closeDialog'); //通知父组件改变
            },
            /**
             * Description:回退
             * Author:wkj
             * Date:2020/10/13
             */
            rollback(){
                this.rollbackdialogLoading = true
            },
            rollbackbackoff(){
                if (this.rollbackeventDescribe == '') {
                    this.$message.error('请填写回退原因');
                    return false
                }
                getFallBack({eventId:this.eventId,reason:this.rollbackeventDescribe}).then((res)=>{
                    this.loading = true;
                    if(res.code == 200){
                        this.$message.success('回退成功');
                        this.loading = false;
                        this.rollbackdialogLoading = false
                        this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                    }
                }).catch((error) => {
                    this.loading = false;
                    console.log(error, 'getFallBack');
                })
            },
            /**
             * Description:新案件详情
             * Author:cy
             * Date:2020/10/13
             */
            xajDetails() {
                let publicData = {
                    type: 6,
                    eventId: this.form.newEventId
                }
                // 初始化详情数据
                this.initPublicData(publicData);
            },
            /**
             * Description:重新处置
             * Author:cy
             * Date:2020/10/13
             */
            cxcz() {
                this.$confirm(this.form.eventName, '确定是否要对该案件进行重新处置', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    this.loading = true;
                    saveCirculationEvent({eventId: this.eventId}).then(
                        (res) => {
                            this.loading = false;
                            this.$message.success('重新处置成功');
                            this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                        }
                    ).catch((error) => {
                        this.loading = false;
                        console.log(error, 'saveCirculationEvent');
                    })
                }).catch(() => {
                    this.$message.info('已取消重新处置');
                });
            },
            /**
             * Description:缓办申请
             * Author:cy
             * Date:2020/10/9
             */
            applyHb() {
                checkHb({eventId: this.eventId}).then(
                    (res) => {
                        if (res.data.isTs == '1') {
                            this.$message.warning('领导交办或媒体曝光的重点问题不得申请缓办！');
                        } else if (res.data.isDelay == '1') {
                            this.$message.warning('该案件已经超时不得申请缓办！');
                        } else if (res.data.wsCount > 0) {
                            this.$message.warning('该案件有未审批的缓办申请！');
                        } else if (res.data.tgCount >= 6) {
                            this.$message.warning('该案件在本月已经申请缓办6次，不得再申请！');
                        } else {
                            this.dialogVisiblehb = true;
                            this.fileList = [];
                            this.hbreason = '';
                        }
                    }
                ).then((error) => {
                    console.log(error, 'checkHb');
                })
            },
            //保存缓办申请
            savehb() {
                if (this.hbreason == '') {
                    this.$message.error('请填写缓办原因');
                    return
                }
                this.$confirm(this.form.eventName, '确定是否要对该案件进行缓办', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    this.loading = true;
                    let formDataCurrent = new FormData();
                    this.fileList.map(tt => {
                        formDataCurrent.append('file', tt.raw);
                    });
                    formDataCurrent.append('eventId', this.eventId);
                    formDataCurrent.append('remark', this.hbreason);
                    saveEventSlow(formDataCurrent).then(
                        (res) => {
                            this.loading = false;
                            this.dialogVisiblehb = false;
                            this.$message.success('缓办申请成功');
                            this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                        }
                    ).catch((error) => {
                        this.loading = false;
                        console.log(error, 'updateEventSlow');
                    })
                }).catch(() => {
                    this.$message.info('已取消缓办申请');
                });
            },
            /**
             * Description:文件状态改变时的钩子
             * Author:ybt
             * Date:2020/9/21
             */
            uploadChange(res) {
                this.fileList.push(res)
            },
            /**
             * Description:点击查看图片
             * Author:ybt
             * Date:2020/9/21
             */
            handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url;
                this.viewImageDialog = true;
            },
            /**
             * Description:删除未上传图片
             * Author:ybt
             * Date:2020/9/21
             */
            handleRemove(file) {
                this.fileList.forEach((item, index) => {
                    if (item.uid === file.uid) {
                        this.fileList.splice(index, 1)
                    }
                })
            },
            /**
             * Description:延期申请
             * Author:cy
             * Date:2020/10/9
             */
            applyDelay() {
                checkDelay({eventId: this.eventId}).then(
                    (res) => {
                        if (res.data.isTs == '1') {
                            this.$message.warning('领导交办或媒体曝光的重点问题不得申请延期！');
                        } else if (res.data.isDelay == '1') {
                            this.$message.warning('该案件已经超时不得申请延期！');
                        } else if (res.data.wsCount > 0) {
                            this.$message.warning('该案件有未审批的延期申请！');
                        } else if (res.data.tgCount >= 10) {
                            this.$message.warning('该案件在本月已经申请延期十次，不得再申请！');
                        } else {
                            this.dialogVisibleyq = true;
                            this.yqreason = '';
                        }
                    }
                ).then((error) => {
                    console.log(error, 'checkDelay');
                })
            },
            //保存延期申请
            saveyq() {
                if (this.yqreason == '') {
                    this.$message.error('请填写延期原因');
                    return
                }
                this.$confirm(this.form.eventName, '确定是否要对该案件进行延期', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    this.loading = true;
                    let data = {
                        eventId: this.eventId,
                        reason: this.yqreason
                    }
                    insertEventDelay(data).then(
                        (res) => {
                            this.loading = false;
                            this.dialogVisibleyq = false;
                            this.$message.success('延期申请成功');
                            this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                        }
                    ).catch((error) => {
                        this.loading = false;
                        console.log(error, 'updateEventSlow');
                    })
                }).catch(() => {
                    this.$message.info('已取消延期申请');
                });
            },
            /**
             * Description:获取案件详情
             * Author:cy
             * Date:2020/9/24
             */
            getEventInfo() {
                this.loading = true;
                let url = null;
                //点击全部案件的详情进入
                if (this.form.type == 0) {
                    url = getEventInfoByEventId;
                }
                getEventInfoByEventId({eventId: this.eventId}).then(
                    (res) => {
                        this.form = res.data;
                        if(this.form.archivesDisposal == []){
                            this.form.time = ""
                        }else{
                            for(let i=0;i<this.form.archivesDisposal.length; i++){
                                if(this.form.archivesDisposal[i].disposalType == "C"){
                                    if(this.form.archivesDisposal[i].times){
                                        let type = this.form.archivesDisposal[i].timesType == '1'?'紧急工作':'工作'
                                        let unit = this.form.archivesDisposal[i].timesUnit == '1'?'时':'日'
                                        this.form.time = this.form.archivesDisposal[i].times + type + unit
                                        break
                                    }
                                }else if(this.form.archivesDisposal[i].disposalType == "B"){
                                    if(this.form.archivesDisposal[i].times){
                                        let type = this.form.archivesDisposal[i].timesType == '1'?'紧急工作':'工作'
                                        let unit = this.form.archivesDisposal[i].timesUnit == '1'?'时':'日'
                                        this.form.time = this.form.archivesDisposal[i].times + type + unit
                                        break
                                    }
                                }else if(this.form.archivesDisposal[i].disposalType == "A"){
                                    if(this.form.archivesDisposal[i].times){
                                        let type = this.form.archivesDisposal[i].timesType == '1'?'紧急工作':'工作'
                                        let unit = this.form.archivesDisposal[i].timesUnit == '1'?'时':'日'
                                        this.form.time = this.form.archivesDisposal[i].times + type + unit
                                        break
                                    }
                                }
                            }
                        }
                        this.loading = false;
                        this.$nextTick(() => {
                            // 初始化地图
                            this.initMap('myMap');
                        });
                    }
                ).catch((error) => {
                    console.log(error, 'getEventInfoByEventId');
                })
            },
            /**
             * Description:获取案件日志图片
             * Author:cy
             * Date:2020/9/24
             */
            getEventLogList() {
                this.loading = true;
                let urllog = null;
                //点击全部案件的详情进入
                if (this.form.type == 0) {
                    urllog = getEventLogList;
                }

                getEventLogList({eventId: this.eventId}).then(
                    (res) => {
                        this.eventLogList = res.data;
                        let _this = this;
                        let logData = this.eventLogList;
                        for (let i = 0; i < logData.length; i++) {
                            $('#timeline_images' + i).html('');
                            var imagesarr = JSON.parse(logData[i].images);
                            _this.str['arr' + i] = [];
                            _this.smallArr['arr' + i] = [];
                            _this.bigArr['arr' + i] = [];
                            if (imagesarr.length > 0) {
                                for (let j = 0; j < imagesarr.length; j++) {
                                    if (imagesarr[j].size_type == 0) {
                                        _this.smallArr['arr' + i].push(imagesarr[j].path);
                                    }
                                    if (imagesarr[j].size_type == 1) {
                                        _this.bigArr['arr' + i].push(imagesarr[j].path);
                                    }
                                }
                            }
                        }
                        this.loading = false;
                    }
                ).catch((error) => {
                    console.log(error, 'getEventLogList');
                })
            },
            /**
             * Description:初始化地图
             * Author:ybt
             * Date:2020/9/23
             */
            initMap(item) {
                let _this = this;
                if (item === 'myMap') {
                    // 高德地图初始化
                    if(_this.form.gdx == null || _this.form.gdy == null){
                        this.GDMap = new AMap.Map('myMap', {
                            zoom: 17,
                            viewMode: '3D',
                            center: [108.99569, 34.20124],
                            resizeEnable: true,
                        });
                    }else{
                        this.GDMap = new AMap.Map('myMap', {
                            zoom: 17,
                            viewMode: '3D',
                            center: [_this.form.gdx, _this.form.gdy],
                            resizeEnable: true,
                        });
                    }
                    //关闭室内地图
                    this.GDMap.on('indoor_create',()=>{
                        this.GDMap.indoorMap.hide();
                    })
                    // 以下为标记点位
                    // 创建一个 Icon
                    let startIcon = new AMap.Icon({
                        size: new AMap.Size(40, 40),
                        image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_bs.png',
                        imageSize: new AMap.Size(20, 30),
                    });
                    if (this.qjBoundaryData.type === 'Polygon') { // 单面
                        this.AcquisitionLine(this.qjBoundaryData.coordinates)

                    } else if (this.qjBoundaryData.type === 'MultiPolygon') { // 多面
                        this.qjBoundaryData.coordinates.forEach(value => {
                            this.AcquisitionLine(value);
                        })
                    } else if (this.qjBoundaryData.type === 'LineString') { // 单线
                        this.AcquisitionLine(this.qjBoundaryData.coordinates[0])
                    } else if (this.qjBoundaryData.type === 'MultiLineString') { // 多线
                        this.qjBoundaryData.coordinates.forEach(value => {
                            this.AcquisitionLine(value);
                        })
                    }
                    if(_this.form.gdx == null || _this.form.gdy == null){
                        return false
                    }else{
                        // 添加点标记
                        this.marker = new AMap.Marker({
                            icon: startIcon, // 点标记的图标
                            position: [_this.form.gdx, _this.form.gdy], // 点标记的坐标
                            clickable: true, // 点标记是否可以点击
                        });
                        this.GDMap.setCenter([this.form.gdx, this.form.gdy]);// 执行定位
                        this.marker.setMap(this.GDMap); // 将点标记添加到地图
                    }
                } else if (item === 'addressMap') {
                    // 高德地图初始化
                    if(this.editForm.gdx == null || this.editForm == null){
                        this.GDMap = new AMap.Map('addressMap', {
                            zoom: 17,
                            viewMode: '3D',
                            center: [108.99569, 34.20124],
                            resizeEnable: true,
                        });
                    }else{
                        this.GDMap = new AMap.Map('addressMap', {
                            zoom: 17,
                            viewMode: '3D',
                            center: [this.editForm.gdx, this.editForm.gdy],
                            resizeEnable: true,
                        });
                    }
                    if (this.qjBoundaryData.type === 'Polygon') { // 单面
                        this.AcquisitionLine(this.qjBoundaryData.coordinates)
                    } else if (this.qjBoundaryData.type === 'MultiPolygon') { // 多面
                        this.qjBoundaryData.coordinates.forEach(value => {
                            this.AcquisitionLine(value);
                        })
                    } else if (this.qjBoundaryData.type === 'LineString') { // 单线
                        this.AcquisitionLine(this.qjBoundaryData.coordinates[0])
                    } else if (this.qjBoundaryData.type === 'MultiLineString') { // 多线
                        this.qjBoundaryData.coordinates.forEach(value => {
                            this.AcquisitionLine(value);
                        })
                    }
                    if(this.editForm.gdx == null || this.editForm == null){
                        return false
                    }else{
                        // 编辑时点位回显
                        this.markPoint(this.GDMap, this.editForm.gdx, this.editForm.gdy);
                    } 
                }
                this.$nextTick( () => {
                    // 注：this.createUser.userType：0——普通用户；1——机构用户
                    // 0101 —— 转办   0201——受理   0202——派遣
                    if (!this.createUser.organizationId && this.publicData.eventDealStatus === '0101') {
                        this.getAllBDJGBj();
                    } else if (this.createUser.organizationId && (this.publicData.eventDealStatus === '0201' || this.publicData.eventDealStatus === '0202')) {
                        this.getOnlyBDJGBj();
                    }
                })
            },
            /**
             * Description:通过二级行业类别获取所有标段机构公司边界
             * Author:ybt
             * Date:2021/1/25
             */
            getAllBDJGBj(){
                getAllBDJGBj({id: this.form.industryTypeLv2}).then( (res) => {
                    res.data.forEach( item => {
                        if (item.st_asgeojson && item.st_asgeojson != '') {
                            let jsonData = JSON.parse(item.st_asgeojson);
                            if (jsonData && jsonData.type === 'MultiPolygon') {
                                jsonData.coordinates.forEach( value => {
                                    this.AcquisitionLine(value, item.color,item.name);
                                })
                            } else if (jsonData && jsonData.type === 'Polygon') {
                                this.AcquisitionLine(jsonData.coordinates, item.color,item.name);
                            }
                        }
                    })
                }).catch((error) => {
                    console.log(error, 'getAllBDJGBj');
                })
            },
            /**
             * Description:通过标段机构编码和行业类别查找边界
             * Author:ybt
             * Date:2021/1/25
             */
            getOnlyBDJGBj(){
                getOnlyBDJGBj({code: this.createUser.organizationId, industryTypeLv2: this.form.industryTypeLv2}).then( (res) => {
                    res.data.forEach( item => {
                        if (item.st_asgeojson && item.st_asgeojson != '') {
                            let jsonData = JSON.parse(item.st_asgeojson);
                            if (jsonData && jsonData.type === 'MultiPolygon') {
                                jsonData.coordinates.forEach( value => {
                                    this.AcquisitionLine(value, item.color);
                                })
                            } else if (jsonData && jsonData.type === 'Polygon') {
                                this.AcquisitionLine(jsonData.coordinates, item.color);
                            }
                        }
                    })
                }).catch((error) => {
                    console.log(error, 'getOnlyBDJGBj');
                })
            },
            /**
             * Description:画曲江边界（画面）
             * Author:ybt
             * Date:2020/7/29
             */
            AcquisitionLine(item,color,name) {
                if (color) {
                    let Polygon = new AMap.Polygon({
                        map: this.GDMap,
                        path: item,
                        strokeColor: '#00b0ff',
                        strokeOpacity: 0.6,
                        strokeWeight: 1,
                        fillColor: color,
                        fillOpacity: 0.6,
                        zIndex: 50,
                        bubble: true,
                    });
                    if(this.isPolygonClick){
                        
                       Polygon.on('click',(e)=>{
                           this.infoWindow = new AMap.InfoWindow({
                            isCustom: false,  //使用自定义窗体
                            anchor: 'bottom-left',
                            content: name,
                        });
                           let position = [e.lnglat.lng,e.lnglat.lat]
                           this.infoWindow.open(this.GDMap,position)
                       })
                    }
                    // this.GDMap.setFitView(Polygon);// 执行定位
                } else {
                    // 曲江边界
                    let Polygon = new AMap.Polygon({
                        map: this.GDMap,
                        path: item,
                        strokeColor: '#ff0000',
                        strokeOpacity: 0.6,
                        strokeWeight: 2,
                        strokeStyle: "dashed",
                        fillColor: '',
                        fillOpacity: 0.6,
                        zIndex: 50,
                        bubble: true,
                    });
                }
            },
            /**
             * Description:地图标记点位
             * Author:ybt
             * Date:2020/9/23
             */
            markPoint(GDMap, lng, lat) {
                // 发生位置X坐标
                this.copyEditAddress.gdx = lng;
                // 发生位置Y坐标
                this.copyEditAddress.gdy = lat;
                // 清除标记点位
                if (this.marker) {
                    this.marker.setMap(null);
                    this.marker = null;
                }
                if (this.copyEditAddress.gdx === '' || this.copyEditAddress.gdy === '') {
                    return
                }

                // 这里通过高德 SDK 完成。
                let geocoder = new AMap.Geocoder({
                    city: "西安"//城市，默认：“全国”
                });
                geocoder.getAddress([lng, lat], (status, result) => {
                    if (status === 'complete' && result.info === 'OK') {
                        if (result && result.regeocode) {
                            this.copyEditAddress.eventAddress = result.regeocode.formattedAddress; // 获取当前位置
                        }
                    }
                });

                // 以下为标记点位
                // 创建一个 Icon
                let startIcon = new AMap.Icon({
                    size: new AMap.Size(40, 40),
                    image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_bs.png',
                    imageSize: new AMap.Size(20, 30),
                });
                // 添加点标记
                this.marker = new AMap.Marker({
                    icon: startIcon, // 点标记的图标
                    position: [this.copyEditAddress.gdx, this.copyEditAddress.gdy], // 点标记的坐标
                    clickable: true, // 点标记是否可以点击
                    draggable: true,
                });
                this.marker.setMap(GDMap); // 将点标记添加到地图
                this.marker.on('dragend', (e) => {
                    this.copyEditAddress.gdx = e.lnglat.lng;
                    this.copyEditAddress.gdy = e.lnglat.lat;
                    // 这里通过高德 SDK 完成。
                    let geocoder = new AMap.Geocoder({
                        city: "西安"//城市，默认：“全国”
                    });
                    geocoder.getAddress([this.copyEditAddress.gdx, this.copyEditAddress.gdy], (status, result) => {
                        if (status === 'complete' && result.info === 'OK') {
                            if (result && result.regeocode) {
                                this.copyEditAddress.eventAddress = result.regeocode.formattedAddress; // 获取当前位置
                            }
                        }
                    });
                    this.GDMap.setCenter([this.copyEditAddress.gdx, this.copyEditAddress.gdy]);// 执行定位
                })
                this.GDMap.setCenter([this.copyEditAddress.gdx, this.copyEditAddress.gdy]);// 执行定位
            },
            /**
             * Description:保存发生位置
             * Author:ybt
             * Date:2020/11/10
             */
            confirmAddress() {
                this.editForm.gdx = this.copyEditAddress.gdx;
                this.editForm.gdy = this.copyEditAddress.gdy;
                this.editForm.eventAddress = this.copyEditAddress.eventAddress;
                this.addressDialog = false;
                this.searchInput = '';
                this.markPoint(null, '', '');
            },
            isActive(route) {
                return route.path === this.$route.path
            },
            toLastView(visitedViews, view) {
                const latestView = visitedViews.slice(-1)[0];
                if (latestView) {
                    this.$router.push(latestView.fullPath)
                } else {
                    if (view.name === 'Dashboard') {
                        this.$router.replace({path: '/redirect' + view.fullPath})
                    } else {
                        this.$router.push('/')
                    }
                }
            },
            /**
             * Description:案件操作
             * Author:cy
             * Date:2020/9/25
             */
            saveEventPendEnd() {
                //案件挂起
                if (this.publicData.type == 2) {
                    this.$confirm(this.form.eventName, '确定结束挂起', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            remark: this.remark
                        };
                        saveEventPendEnd(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisible = false;
                                this.$message.success('结束挂起成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'saveEventPendEnd');
                        })
                    }).catch(() => {
                        this.$message.info('已取消结束挂起');
                    });
                }

                //案件待审批：缓办、延期审批
                if (this.publicData.type == 1) {
                    if (this.pendingApproval.auditStatus == '') {
                        this.$message.error('请选择审批状态');
                        return
                    }
                    if (this.pendingApproval.auditDetails == '') {
                        this.$message.error('请添加审批意见');
                        return
                    }
                    this.$confirm(this.form.eventName, '是否通过案件审批', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            auditDetails: this.pendingApproval.auditDetails,
                            auditStatus: this.pendingApproval.auditStatus,
                        };
                        //缓办审批
                        if (this.publicData.eventType == 'slow') {
                            updateEventSlow(options).then(
                                (res) => {
                                    this.loading = false;
                                    this.dialogVisible = false;
                                    this.$message.success('缓办审批成功');
                                    this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                                }
                            ).catch((error) => {
                                this.loading = false;
                                console.log(error, 'updateEventSlow');
                            })
                        }
                        //延期审批
                        if (this.publicData.eventType == 'delay') {
                            updateEventDelay(options).then(
                                (res) => {
                                    this.loading = false;
                                    this.dialogVisible = false;
                                    this.$message.success('缓办审批成功');
                                    this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                                }
                            ).catch((error) => {
                                this.loading = false;
                                console.log(error, 'updateEventDelay');
                            })
                        }

                    }).catch(() => {
                        this.$message.info('已取消案件审批');
                    });
                }

                //案件转办
                if (this.publicData.type == 3 && this.publicData.eventDealStatus === '0101') {
                    if (this.transfer.organizationid == '') {
                        this.$message.error('请选择转办机构');
                        return
                    }
                    this.$confirm(this.form.eventName, '确定是否转办', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            remark: this.transfer.remark,
                            type: 1,
                            organizationid: this.transfer.organizationid,
                        };
                        handleshunt(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisible = false;
                                this.$message.success('案件转办成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'handleshunt');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件转办');
                    });
                }

                //案件派遣
                if (this.publicData.type == 4 && this.publicData.eventDealStatus === '0202' || this.publicData.eventDealStatus === '0204') {
                    if (this.dispatch.sendTargetId == '') {
                        this.$message.error('请选择派遣机构');
                        return
                    }
                    this.$confirm(this.form.eventName, '确定是否派遣', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            sendTargetId: this.dispatch.sendTargetId
                        };
                        eventThreeSend(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisible = false;
                                this.$message.success('案件派遣成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'eventThreeSend');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件派遣');
                    });
                }
            },
            /**
             * Description:其他方式结案下拉选择出发
             * Author:ybt
             * Date:2020/9/30
             */
            handleChange() {
                this.otherReasonData.forEach(item => {
                    if (item.id === this.otherSelect) {
                        this.ja.remark = item.name
                    }
                })
            },
            /**
             * Description:案件销案
             * Author:cy
             * Date:2020/9/29
             */
            eventhandleClose() {
                this.cancellation.remark = '';
                this.dialogVisiblexa = true;
            },
            /**
             * Description:保存销案
             * Author:ybt
             * Date:2020/9/30
             */
            saveCancellation() {
                this.dialogLoading = true;
                if (this.cancellation.remark === '') {
                    this.$message.error('请输入销案备注');
                    this.dialogLoading = false;
                    return
                }
                this.$confirm(this.form.eventName, '确定是否销案该案件', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    let options = {
                        eventId: this.eventId,
                        remark: this.cancellation.remark,
                    };
                    caseCancellation(options).then(() => {
                        this.dialogVisiblexa = false;
                        this.dialogLoading = false;
                        this.$message.success('案件销案成功');
                        this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                    }).catch((error) => {
                        this.dialogLoading = false;
                        console.log(error, 'updateDelFlagById');
                    })
                }).catch(() => {
                    this.dialogLoading = false;
                    this.$message.info('已取消案件回退');
                });
            },
            /**
             * Description:案件回退
             * Author:cy
             * Date:2020/9/29
             */
            eventbackoff() {
                //案件回退
                if (this.publicData.type == 4 && this.publicData.eventDealStatus === '0201' || this.publicData.eventDealStatus === '0202') {
                    if (this.backoff.eventDescribe === '') {
                        this.$message.error('请输入回退描述');
                        return
                    }
                    let _this = this;
                    this.$confirm(_this.form.eventName, '确定是否回退该案件', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: _this.eventId,
                            id: _this.publicData.eventThreeID,
                            params: {
                                eventDescribe: _this.backoff.eventDescribe
                            }
                        };
                        updateDelFlagById(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisible2 = false;
                                this.$message.success('案件回退成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'updateDelFlagById');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件回退');
                    });
                }
            },
            /**
             * Description:案件督办
             * Author:cy
             * Date:2020/9/29
             */
            EventOversee() {
                this.eventOversee.contents = '';
                if (this.publicData.type == 3 || this.publicData.type == 4 || this.publicData.type == 5) {
                    this.title = '案件督办';
                }
                this.dialogVisible1 = true;
            },
            saveeventOversee() {
                if (this.eventOversee.contents === '') {
                    this.$message.error('请输入督办意见');
                    return
                }
                this.$confirm(this.form.eventName, '确定是否对该案件进行督办', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    this.loading = true;
                    let options = {
                        eventId: this.eventId,
                        contents: this.eventOversee.contents
                    };
                    eventOversee(options).then(
                        (res) => {
                            this.loading = false;
                            this.dialogVisible1 = false;
                            this.$message.success('案件督办成功');
                            this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                        }
                    ).catch((error) => {
                        this.loading = false;
                        console.log(error, 'eventOversee');
                    })
                }).catch(() => {
                    this.$message.info('已取消案件督办');
                });
            },
            /**
             * Description:案件受理
             * Author:cy
             * Date:2020/9/28
             */
            eventDealwith() {
                //案件受理
                if (this.publicData.type == 4 && this.publicData.eventDealStatus == '0201') {
                    this.$confirm(this.form.eventName, '确定是否受理该案件', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            id: this.publicData.eventThreeID
                        };
                        eventThreeAccept(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisible = false;
                                this.$message.success('案件受理成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'eventThreeAccept');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件受理');
                        this.loading = false;
                    });
                }
                //处置机构审核
                if (this.publicData.type == 4 && this.publicData.eventDealStatus === '0204') {
                    this.$confirm(this.form.eventName, '确定是否对该案件进行审核', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            remark: this.czjgremark
                        };
                        eventThreeExamine(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisibleczjg = false;
                                this.$message.success('案件审核成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'eventThreeExamine');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件审核');
                    });
                }
                //监理审核
                if (this.publicData.type == 5 && this.publicData.eventDealStatus === '0205') {
                    this.$confirm(this.form.eventName, '确定是否对该案件进行审核', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            remark: this.jlremark
                        };
                        JLeventThreeExamine(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisiblejl = false;
                                this.$message.success('案件审核成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'JLeventThreeExamine');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件审核');
                    });
                }
            },
            /**
             * Description:监理驳回
             * Author:cy
             * Date:2020/9/29
             */
            eventReject1() {
                this.eventReject.remark = '';
                this.dialogVisiblebh = true;
            },
            saveeventReject() {
                if (this.eventReject.remark === '') {
                    this.$message.error('请输入备注');
                    return
                }
                this.$confirm(this.form.eventName, '确定是否对该案件进行驳回', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    this.loading = true;
                    let options = {
                        eventId: this.eventId,
                        remark: this.eventReject.remark
                    };
                    eventReject(options).then(
                        (res) => {
                            this.loading = false;
                            this.dialogVisiblebh = false;
                            this.$message.success('案件驳回成功');
                            this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                        }
                    ).catch((error) => {
                        this.loading = false;
                        console.log(error, 'eventReject');
                    })
                }).catch(() => {
                    this.$message.info('已取消案件驳回');
                });
            },
            //办理的挂起
            savegq() {
                if (this.blgq.pendReason === '') {
                    this.$message.error('请选择挂起原因');
                    return
                }
                this.$confirm(this.form.eventName, '确定是否对该案件进行挂起申请', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                    center: true
                }).then(() => {
                    this.loading = true;
                    let data = {
                        eventId: this.eventId,
                        pendReason: this.blgq.pendReason,
                        pendRemark: this.blgq.pendRemark
                    };
                    saveEventPend(data).then(
                        (res) => {
                            this.loading = false;
                            this.dialogVisiblegq = false;
                            this.$message.success('案件挂起申请成功');
                            this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                        }
                    ).catch((error) => {
                        this.loading = false;
                        console.log(error, 'saveEventPend');
                    })
                }).catch(() => {
                    this.$message.info('已取消案件挂起申请');
                });
            },
            //重新转办
            savecxzb() {
                if (this.publicData.type == 3 && this.publicData.eventDealStatus === '0206') {
                    if (this.transfer.organizationid == '') {
                        this.$message.error('请选择转办机构');
                        return
                    }
                    this.$confirm(this.form.eventName, '确定是否转办', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            remark: this.transfer.remark,
                            type: 1,
                            organizationid: this.transfer.organizationid,
                        };
                        handleshunt(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisiblecxzb = false;
                                this.$message.success('案件转办成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'handleshunt');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件转办');
                    });
                }
            },
            saveja3() {
                //案件结案
                if (this.publicData.type == 3 && this.publicData.eventDealStatus != '0207') {
                    this.$confirm(this.form.eventName, '确定是否对该案件进行结案', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            remark: this.ja.remark
                        };
                        let url = '';
                        if (this.closeCaseType === 0) {
                            url = handleover;
                        } else if (this.closeCaseType === 1) {
                            url = otherCloseCase;
                        }
                        url(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisibleja3 = false;
                                this.$message.success('案件结案成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'handleover');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件结案');
                    });
                }
                if (this.publicData.type == 3 && this.publicData.eventDealStatus === '0101') {
                    this.$confirm(this.form.eventName, '确定是否对该案件进行结案', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        this.loading = true;
                        let options = {
                            eventId: this.eventId,
                            remark: this.ja.remark
                        };
                        let url = '';
                        if (this.closeCaseType === 0) {
                            url = handleover;
                        } else if (this.closeCaseType === 1) {
                            url = otherCloseCase;
                        }
                        url(options).then(
                            (res) => {
                                this.loading = false;
                                this.dialogVisibleja3 = false;
                                this.$message.success('案件结案成功');
                                this.$emit('getList'); // 通知父组件关闭弹窗刷新列表
                            }
                        ).catch((error) => {
                            this.loading = false;
                            console.log(error, 'handleover');
                        })
                    }).catch(() => {
                        this.$message.info('已取消案件结案');
                    });
                }
            },
            openja3(type, other) {
                let _this = this;
                //案件结案
                if (this.publicData.type == 3 && this.publicData.eventDealStatus !== '0207' && type === 'jiean') {
                    if (other === 'other') {
                        // 获取结案原因
                        otherCloseData().then((res) => {
                            _this.otherReasonData = res.data;
                        }).catch((error) => {
                            console.log(error, 'otherCloseData');
                        });
                        _this.title = '其他方式结案';
                        _this.closeCaseType = 1;
                        _this.otherSelect = '';
                        _this.ja.remark = '';
                    } else {
                        _this.title = '案件结案';
                        _this.closeCaseType = 0;
                        _this.ja.remark = '';
                    }
                    _this.dialogVisibleja3 = true;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisiblecxzb = false;
                }
                if (this.publicData.type == 3 && this.publicData.eventDealStatus === '0101' && type === 'jiean') {
                    if (other === 'other') {
                        // 获取结案原因
                        otherCloseData().then((res) => {
                            _this.otherReasonData = res.data;
                        }).catch((error) => {
                            console.log(error, 'otherCloseData');
                        });
                        _this.title = '其他方式结案';
                        _this.closeCaseType = 1;
                    } else {
                        _this.title = '案件结案';
                        _this.closeCaseType = 0;
                    }
                    _this.dialogVisibleja3 = true;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisiblecxzb = false;
                }
            },
            //弹出层
            opendialog(type, other) {
                //结束挂起备注
                this.remark = '';
                this.pendingApproval.auditDetails = '';
                this.pendingApproval.auditStatus = '';
                this.transfer.organizationid = '';
                this.transfer.remark = '';
                this.ja.remark = '';
                this.czjgremark = '';
                this.jlremark = '';
                this.blgq.pendReason = '';
                this.blgq.pendRemark = '';
                let _this = this;
                //案件挂起
                if (this.publicData.type == 2) {
                    _this.title = '结束挂起';
                    _this.dialogVisible = true;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblecxzb = false;
                    _this.dialogVisibleja3 = false;
                }
                //案件待审批
                if (this.publicData.type == 1) {
                    _this.title = '案件审批';
                    _this.dialogVisible = true;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblecxzb = false;
                    _this.dialogVisibleja3 = false;
                }
                //案件转办
                if (this.publicData.type == 3 && this.publicData.eventDealStatus == '0101' && type === 'zhuanban') {
                    this.transfer.organizationid = ""
                    _this.title = '案件转办';
                    getOrganization({eventId: this.publicData.eventId}).then(
                        (res) => {
                            this.transfer.organizationData = res.data;
                            this.transfer.organizationid = this.transfer.organizationData[0].code
                        }
                    ).catch((error) => {
                        console.log(error, 'getOrganization');
                    });
                    _this.dialogVisible = true;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblecxzb = false;
                    _this.dialogVisibleja3 = false;
                }
                //案件转办
                if (this.publicData.type == 3 && this.publicData.eventDealStatus == '0206' && type === 'cxzhuanban') {
                    this.transfer.organizationid = ""
                    _this.title = '案件重新转办';
                    getOrganization({eventId: this.publicData.eventId}).then(
                        (res) => {
                            this.transfer.organizationData = res.data;
                            this.transfer.organizationid = this.transfer.organizationData[0].code
                        }
                    ).catch((error) => {
                        console.log(error, 'getOrganization');
                    });
                    _this.dialogVisiblecxzb = true;
                    _this.dialogVisible = false;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisibleja3 = false;
                }
                //案件办理的挂起
                if (this.publicData.type == 3 && type === 'guaqi') {
                    if (this.publicData.eventDealStatus !== '0207' && this.publicData.eventStatus !== '0000') {
                        _this.title = '案件挂起申请';
                        _this.dialogVisiblegq = true;
                        _this.dialogVisibleczjg = false;
                        _this.dialogVisible = false;
                        _this.dialogVisible2 = false;
                        _this.dialogVisiblejl = false;
                        _this.dialogVisiblecxzb = false;
                        _this.dialogVisibleja3 = false;
                        _this.blgq.pendReason = '';
                        _this.blgq.pendRemark = '';
                        pendReason().then(
                            (res) => {
                                _this.pendReasonData = res.data;
                            }
                        ).catch((error) => {
                            console.log(error, 'pendReason');
                        })
                    }
                }
                //案件派遣
                if (this.publicData.type == 4 && type !== 'backoff' && type === 'paiqian') {
                    _this.dispatch.default = false 
                    _this.dispatch.selectPqcumsum = ''
                    _this.dispatch.sendTargetId = '';
                    _this.title = '案件派遣';
                    let data = {
                        eventId: _this.publicData.eventId,
                        organizationCode: _this.form.eventThree.organizationid
                        // eventId: '1049',
                        // organizationCode: '10'
                    };
                    eventThreeCzry(data).then(
                        (res) => {
                            if(res.data == []){
                                _this.dispatch.sendTargetIdData = []
                            }else {
                                _this.dispatch.sendTargetIdData = res.data;
                                _this.dispatch.sendTargetIdData.forEach((item,index) => {
                                    if(item.is_default == '1'){
                                        if(index == 0){
                                            _this.dispatch.selectPqcumsum +=   item.nickname 
                                        }else{
                                            _this.dispatch.selectPqcumsum +=  '/' + item.nickname 
                                        }
                                        
                                    }
                                })
                                if(_this.dispatch.sendTargetIdData[0].is_default == '1'){
                                    _this.dispatch.sendTargetId = _this.dispatch.sendTargetIdData[0].userid
                                    _this.dispatch.selectPq = _this.dispatch.sendTargetIdData[0].nickname
                                    _this.dispatch.default = true
                                }else {
                                    _this.dispatch.default = false 
                                }
                            }
                            
                        }
                    ).catch((error) => {
                        console.log(error, 'eventThreeCzry');
                    })
                    _this.dialogVisible = true;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblecxzb = false;
                    _this.dialogVisibleja3 = false;
                }
                //案件回退
                if (this.publicData.type == 4 && type == 'backoff') {
                    _this.title = '案件回退';
                    _this.dialogVisible2 = true;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisible = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisibleja3 = false;
                }

                //处置机构审核
                if (this.publicData.type == 4 && this.publicData.eventDealStatus === '0204' && type === 'shenhe') {
                    _this.dialogVisibleczjg = true;
                    _this.dialogVisible = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblejl = false;
                    _this.dialogVisiblecxzb = false;
                    _this.dialogVisibleja3 = false;
                }
                //监理审核
                if (this.publicData.type == 5 && this.publicData.eventDealStatus === '0205' && type === 'shenhe') {
                    _this.dialogVisiblejl = true;
                    _this.dialogVisibleczjg = false;
                    _this.dialogVisible = false;
                    _this.dialogVisiblegq = false;
                    _this.dialogVisible2 = false;
                    _this.dialogVisiblecxzb = false;
                    _this.dialogVisibleja3 = false;
                }
            },
            //关闭当前标签
            closeSelectedTag(view) {
                this.$store.dispatch('tagsView/delView', view).then(({visitedViews}) => {
                    if (this.isActive(view)) {
                        this.toLastView(visitedViews, view)
                    }
                })
            },
            refreshSelectedTag(view) {
                this.$store.dispatch('tagsView/delCachedView', view).then(() => {
                    const {fullPath} = view;
                    this.$nextTick(() => {
                        this.$router.replace({
                            path: '/redirect' + fullPath
                        })
                    })
                })
            },
            /**
             * Description:查看街景
             * Author:ybt
             * Date:2020/10/29
             */
            toStreetView() {
                const {href} = this.$router.resolve({
                    path: '/streetView/index',
                    name: 'streetView',
                    query: {
                        x: this.form.bdx,
                        y: this.form.bdy,
                    }
                });
                window.open(href, '_blank');
            },
            /**
             * Description:编辑案件
             * Author:ybt
             * Date:2020/11/6
             */
            editCase(type) {
                if (type === 0) {
                    this.editForm = $.extend(true, {}, this.form);
                    this.editForm.isOpenScenic = String(this.form.isOpenScenic);
                    // 获取案件类别下拉数据
                    this.getCaseType();
                    // 获取案件大类
                    this.getCaseBigClass();
                    // 获取案件小类
                    this.getCaseSmallClass();
                    // 获取立案条件
                    this.getCaseCondition();
                    // 获取开放景区数据
                    this.getkfjq();
                    this.editDialogVisible = true;
                } else if (type === 1) {
                    this.editDialogloading = true;
                    if (this.editForm.eventType === '') {
                        this.$message.error('请选择案件类别');
                        this.editDialogloading = false;
                        return
                    } else if (this.editForm.eventTypeLv1 === '') {
                        this.$message.error('请选择案件大类');
                        this.editDialogloading = false;
                        return
                    } else if (this.editForm.eventTypeLv2 === '') {
                        this.$message.error('请选择案件小类');
                        this.editDialogloading = false;
                        return
                    } else if (this.editForm.eventTypeLv3 === '') {
                        this.$message.error('请选择立案条件');
                        this.editDialogloading = false;
                        return
                    } else if (this.editForm.eventAddress === '') {
                        this.$message.error('请定位发生位置');
                        this.loading = false;
                        return
                    } else if (this.editForm.isOpenScenic === '') {
                        this.$message.error('请选择是否开放景区');
                        this.loading = false;
                        return
                    } else if (this.editForm.eventDescribe === '') {
                        this.$message.error('请输入案件描述');
                        this.editDialogloading = false;
                        return
                    }
                    editRegisterInfo(this.editForm).then(() => {
                        this.$message.success('修改成功')
                        this.editDialogVisible = false;
                        this.editDialogloading = false;
                        // 获取案件详情数据
                        this.getEventInfo();
                    }).catch((error) => {
                        this.editDialogloading = false;
                        console.log(error, 'submitRegisterInfo')
                    })
                }
            },
            /**
             * Description:获取案件类别数据
             * Author:ybt
             * Date:2020/9/23
             */
            getCaseType() {
                getcaseType({}).then((res) => {
                    this.caseTypeData = res.data;
                }).catch((error) => {
                    console.log(error, 'getcaseType')
                })
            },
            /**
             * Description:获取案件大类
             * Author:ybt
             * Date:2020/9/23
             */
            getCaseBigClass(bool) {
                this.editDialogloading = true;
                if (bool) {
                    this.editForm.eventTypeLv1 = '';
                    this.editForm.eventTypeLv2 = '';
                    this.editForm.eventTypeLv3 = '';
                    this.editForm.deptParentCode = '';
                    this.editForm.deptParentName = '';
                    this.editForm.deptCode = '';
                    this.editForm.deptName = '';
                    this.editForm.industryTypeLv1 = '';
                    this.editForm.industryTypeLv1Name = '';
                    this.editForm.industryTypeLv2 = '';
                    this.editForm.industryTypeLv2Name = '';
                    this.editForm.isYq = '';
                    this.editForm.isHb = '';
                    this.editForm.isTf = '';
                    this.editForm.isJj = '';
                }
                getcategoryName({type: this.editForm.eventType}).then((res) => {
                    this.caseBigClassData = res.data;
                    this.editDialogloading = false;
                }).catch((error) => {
                    this.editDialogloading = false;
                    console.log(error, 'getcategoryName')
                })
            },
            /**
             * Description:获取案件小类
             * Author:ybt
             * Date:2020/9/23
             */
            getCaseSmallClass(bool) {
                this.editDialogloading = true;
                if (bool) {
                    this.editForm.eventTypeLv2 = '';
                    this.editForm.eventTypeLv3 = '';
                    this.editForm.deptParentCode = '';
                    this.editForm.deptParentName = '';
                    this.editForm.deptCode = '';
                    this.editForm.deptName = '';
                    this.editForm.industryTypeLv1 = '';
                    this.editForm.industryTypeLv1Name = '';
                    this.editForm.industryTypeLv2 = '';
                    this.editForm.industryTypeLv2Name = '';
                    this.editForm.isYq = '';
                    this.editForm.isHb = '';
                    this.editForm.isTf = '';
                    this.editForm.isJj = '';
                }
                getsubclassName({parentId: this.editForm.eventTypeLv1}).then((res) => {
                    this.caseSmallClassData = res.data;
                    this.editDialogloading = false;
                }).catch((error) => {
                    this.editDialogloading = false;
                    console.log(error, 'getsubclassName')
                })
            },
            /**
             * Description:获取立案条件下拉数据
             * Author:ybt
             * Date:2020/9/23
             */
            getCaseCondition(bool) {
                this.editDialogloading = true;
                if (bool) {
                    this.editForm.eventTypeLv3 = '';
                    this.editForm.deptParentCode = '';
                    this.editForm.deptParentName = '';
                    this.editForm.deptCode = '';
                    this.editForm.deptName = '';
                    this.editForm.industryTypeLv1 = '';
                    this.editForm.industryTypeLv1Name = '';
                    this.editForm.industryTypeLv2 = '';
                    this.editForm.industryTypeLv2Name = '';
                    this.editForm.isYq = '';
                    this.editForm.isHb = '';
                    this.editForm.isTf = '';
                    this.editForm.isJj = '';
                }
                getCaseCondition({id: this.editForm.eventTypeLv2}).then((res) => {
                    this.caseConditionData = res.data;
                    this.editDialogloading = false;
                }).catch((error) => {
                    this.editDialogloading = false;
                    console.log(error, 'getCaseCondition')
                })
            },
            /**
             * Description:根据立案条件查询责任主体、部门、一级行业、二级行业等信息
             * Author:ybt
             * Date:2020/9/23
             */
            getOtherInfo() {
                this.editForm.deptParentCode = '';
                this.editForm.deptParentName = '';
                this.editForm.deptCode = '';
                this.editForm.deptName = '';
                this.editForm.industryTypeLv1 = '';
                this.editForm.industryTypeLv1Name = '';
                this.editForm.industryTypeLv2 = '';
                this.editForm.industryTypeLv2Name = '';
                this.editForm.isYq = '';
                this.editForm.isHb = '';
                this.editForm.isTf = '';
                this.editForm.isJj = '';
                getOtherInfo({id: this.editForm.eventTypeLv3}).then((res) => {
                    this.allOtherInfo = res.data;
                    
                    // 责任主体
                    this.editForm.deptParentCode = this.allOtherInfo.parentDeptCode;
                    this.editForm.deptParentName = this.allOtherInfo.parentDeptName;
                    // 所属部门
                    this.editForm.deptCode = this.allOtherInfo.deptCode;
                    this.editForm.deptName = this.allOtherInfo.deptName;
                    // 一级行业
                    this.editForm.industryTypeLv1 = this.allOtherInfo.industryTypeLv1;
                    this.editForm.industryTypeLv1Name = this.allOtherInfo.industryTypeLv1Name;
                    // 二级行业
                    this.editForm.industryTypeLv2 = this.allOtherInfo.industryTypeLv2;
                    this.editForm.industryTypeLv2Name = this.allOtherInfo.industryTypeLv2Name;
                    // 是否延期
                    this.editForm.isYq = this.allOtherInfo.isYq;
                    // 是否缓办
                    this.editForm.isHb = this.allOtherInfo.isHb;
                    // 是否突发
                    this.editForm.isTf = this.allOtherInfo.isTf;
                    // 是否紧急
                    this.editForm.isJj = this.allOtherInfo.isJj;
                }).catch((error) => {
                    console.log(error, 'getOtherInfo')
                })
            },
            /**
             * Description:获取开放景区数据
             * Author:cy
             * Date:2020/10/10
             */
            getkfjq() {
                getkfjq({}).then((res) => {
                    this.isOpenScenicData = res.data
                }).catch((error) => {
                    console.log(error, 'getkfjq')
                })
            },
            /**
             * Description:编辑案件——选择发生位置——地图标点
             * Author:ybt
             * Date:2020/11/10
             */
            selectAddress() {
                this.addressDialog = true;
                this.$nextTick(() => {
                    this.searchInput = '';
                    this.initMap('addressMap');
                })
            },
            /**
             * Description:导出案件PDF
             * Author:ybt
             * Date:2021/2/1
             */
            exportCasePDF(){
                this.loading = true;
                exportCasePDF({eventIds:[this.publicData.eventId],size:'A4',delay:'2000'}).then((res) => {
                    this.download(res.msg);
                    this.loading = false;
                }).catch((error) => {
                    this.loading = false;
                    console.log(error, 'exportCasePDF')
                })
            },
            switchChange(val){
                let obj = {
                    eventId:this.form.eventId,
                    industryTypelv2Id:this.form.industryTypeLv2
                    // eventId:337,
                    // industryTypelv2Id:14
                }
                if(val){
                    getTypelv2MapData(obj).then(res=>{
                    this.infoWindowText = res.data[0].describes
                    let mapDatas = JSON.parse(res.data[0].gcj_geometry)
                        if (mapDatas.type === 'Polygon') { // 单面
                            let Polygon = new AMap.Polygon({
                            map: this.GDMap,
                            path: mapDatas.coordinates,
                            strokeColor: 'gray',
                            strokeOpacity: 0.6,
                            strokeWeight: 1,
                            fillColor: 'gray',
                            fillOpacity: 0.6,
                            zIndex: 50,
                            bubble: true,
                        });
                        Polygon.on('click',(e)=>{
                           let position = [e.lnglat.lng,e.lnglat.lat]
                           this.infoWindow = new AMap.InfoWindow({
                                isCustom: false,  //使用自定义窗体
                                anchor: 'bottom-left',
                                content: res.data[0].describes,
                            });
                           this.infoWindow.open(this.GDMap,position)
                       })
                        this.Typelv2MapData.push(Polygon)
                    } else if (mapDatas.type === 'MultiPolygon') { // 多面
                        mapDatas.coordinates.forEach(value => {
                            let Polygon = new AMap.Polygon({
                                map: this.GDMap,
                                path: mapDatas.coordinates,
                                strokeColor: 'red',
                                strokeOpacity: 0.6,
                                strokeWeight: 1,
                                fillColor: 'red',
                                fillOpacity: 0.6,
                                zIndex: 50,
                                bubble: true,
                            });
                            Polygon.on('click',(e)=>{
                            let position = [e.lnglat.lng,e.lnglat.lat]
                            this.infoWindow = new AMap.InfoWindow({
                                    isCustom: false,  //使用自定义窗体
                                    anchor: 'bottom-left',
                                    content: res.data[0].describes,
                                });
                            this.infoWindow.open(this.GDMap,position)
                       })
                            this.Typelv2MapData.push(Polygon)
                        })
                    }
                })
                }else{
                    if(this.infoWindow.w.content === this.infoWindowText){
                        this.infoWindow.close()
                        this.infoWindowText = ''
                    }
                    this.GDMap.remove(this.Typelv2MapData)
                    this.Typelv2MapData = []
                }
                
                
            }
        },
    }
</script>

<style lang="scss">
    .organization_body{
        width: 100%;
        height: 1.4625rem;
        background-color: #eeeeee;
        margin-bottom: 0.3rem;
        border-radius: 0.1875rem;
        .organization_body_p,
        .organization_body_notp{
            text-align: center;
            font-size: 20px;
            color: #3573ae;
            font-weight: 600;
        }
        .organization_body_notp{
            line-height: 1rem;
        }
    }
    .public-detail {
        .paiqian {
            .el-radio {
                .el-radio__label {
                    span {
                        &:nth-of-type(1) {
                            width: 1.5625rem;
                            display: inline-block;
                        }
                    }
                }
            }

            .selectPerson {
                height: 130px;
                background: #eeeeee;
                border-radius: 10px;
                margin: 0 auto;
                display: flex;
                justify-content: center;
                flex-wrap: wrap;
                align-content: center;

                .InspectorMes {
                    display: flex;
                    align-items: baseline;

                    img {
                        width: 0.25rem;
                        height: 0.275rem;
                        margin-right: 0.125rem;
                    }

                    .name {
                        font-size: 0.25rem;
                        color: #2b7caa;
                    }

                    .identity {
                        font-size: 0.15rem;
                        color: #8a8a8a;
                    }

                    span {
                        display: inline-block;
                        margin-right: 0.125rem;
                    }

                    .phone {
                        font-size: 0.175rem;
                        color: #8a8a8a;
                    }

                    .break {
                        display: inline-block;
                        margin: 0 0.125rem;
                        width: 0.1875rem;
                    }
                }

                .times {
                    width: 4.4rem;
                    font-size: 0.175rem;
                    color: #72aacb;
                    text-align: center;
                    border-top: 0.0125rem solid #8a8a8a;
                    margin-top: 0.0625rem;
                    padding-top: 0.0625rem;
                }
            }

            .paiqianTop {
                background: #EEEEEE;
                border-radius: 10px;
                width: 100%;
                margin: 0 auto;
                margin-top: -10px;
                display: flex;
                flex-wrap: wrap;
                justify-content: center;
                padding: 15px 0 5px;
                height: 130px;
                line-height: 98px;
                font-weight: 600;
                letter-spacing: 2px;

                .p1 {
                    font-size: 0.275rem;
                    color: #5c9cc1;
                    width: 100%;
                    margin: 0;
                    text-align: center;
                }

                .p2 {
                    font-size: 0.175rem;
                    color: #989696;
                    width: 100%;
                    margin: 0;
                    text-align: center;
                    margin-top: 0.1rem;
                    margin-bottom: 0.0625rem;
                }

                img {
                    width: 0.325rem;
                }
            }

            .Inspectors {
                position: relative;
                height: 2.75rem;
                border-top: 0.0125rem solid #c7c7c7;
                margin-top: 0.2875rem;
                border-bottom: 0.0125rem solid #c7c7c7;

                .tips {
                    width: 1.375rem;
                    display: flex;
                    justify-content: center;
                    background: #fff;
                    position: absolute;
                    top: -0.1875rem;
                    left: 0;
                    right: 0;
                    margin: auto;
                    color: #fff;

                    span {
                        display: inline-block;
                        padding: 0.075rem 0.275rem;
                        margin: 0 auto;
                        width: 1.25rem;
                        background: #72aacb;
                        border-radius: 0.625rem;
                    }
                }

                .xjyDiv {
                    height: 2.5rem;
                    overflow-y: auto;
                    margin-top: 0.1875rem;

                    .dinp1 {
                        position: relative;
                        overflow: hidden;
                        height: 0.5rem;
                        display: flex;
                        align-items: center;
                        margin: 0;
                        margin-top: 0.1rem;
                        margin-bottom: 0.1rem;
                        font-size: 0.1875rem;

                        &:hover {
                            height: 0.5rem;
                            background: #f1f1f1;
                            color: #438eb9;
                        }

                        .el-radio__label {
                            font-size: 0.1875rem;
                        }

                        .el-radio__inner {
                            width: 0.225rem;
                            height: 0.225rem;

                        }

                        .el-radio__input.is-checked .el-radio__inner {
                            border-color: #72aacb;
                            background: #72aacb;
                        }

                        .el-radio__input.is-checked + .el-radio__label {
                            color: #72aacb;
                        }
                    }
                }
            }
        }
    }

    .public-dialog {
        position: absolute !important;
        width: 100%;
        height: 100%;
        overflow: hidden;
        padding: 10px 15px !important;

        & > .el-dialog {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100%;
            margin-top: 0 !important;
            overflow: hidden;

            .el-dialog__body {
                display: flex;
                flex: 1;
                padding: 0 !important;
                overflow: hidden;

            }
        }
    }

    .case-details {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: row;
        overflow: hidden;
        padding: 0.1875rem;

        .left-info {
            display: flex;
            flex-direction: column;
            width: 50%;
            height: 100%;
            background-color: #FFFFFF;
            border: 0.0125rem solid #A40000;
            overflow: hidden;

            .title-name {
                height: 0.4375rem;
                line-height: 0.4375rem;
                background: #A40000;
                text-align: center;
                color: #fff;
                font-size: 0.225rem;
                margin: 0 !important;
            }

            .info-content {
                display: flex;
                flex-direction: column;
                flex: 1;
                overflow: auto;

                .top-box {
                    display: flex;
                    flex-direction: row;
                    flex-wrap: wrap;
                    padding-right: 0.25rem;
                    margin-top:0.125rem;
                }
                .map-box {
                    width: 100%;
                    height: 3.75rem;
                    min-height: 3.75rem;
                    border-top: 0.0125rem solid #ddd;
                    padding: 0.125rem;

                    #myMap {
                        width: 100%;
                        height: 100%;
                    }
                }
            }

            .foot-btn {
                border-top: 0.0125rem solid #ddd;
                padding: 0 0.25rem 0.125rem;
                text-align: right;

                div.btns {
                    display: inline-block;

                    .el-button {
                        margin-left: 0.125rem;
                    }
                }

                .el-button {
                    margin-top: 0.125rem;
                }
            }
        }

        .right-process {
            width: 50%;
            background-color: #FFFFFF;
            border: 0.0125rem solid #A40000;
            overflow: auto;
            padding: 0.1875rem;

            .el-timeline {
                padding: 0;

                .el-card__body {
                    display: flex;
                    justify-content: space-between;

                    .timeline_images {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        padding-left: 0.125rem;

                        .images_item {
                            width: 0.9375rem;
                            height: 1.125rem;
                            padding: 0.025rem;
                            border: 0.0125rem solid #ccc;
                            margin-left: 0.1875rem;
                            list-style: none;

                            img {
                                display: inline-block;
                                width: 100%;
                                height: 100%;
                                cursor: pointer;
                            }
                        }
                    }
                }

                #title0021 {
                    .el-timeline-item__timestamp {
                        color: red;
                    }
                }
            }
        }

        .bigImg {
            .el-dialog__body {
                display: flex;
                align-items: center;
                justify-content: center;

                img {
                    width: auto !important;
                    height: auto;
                    max-width: 100%;
                    max-height: 100%;
                }
            }
        }
    }

    .el-dialog {
        .info-content {
            flex: 1;

            .bottom-box {
                flex: 1;
            }
        }

        .line-item {
            display: flex;
            width: 100%;
            margin-bottom: 0.125rem;
        }

        .block-box {
            width: 100%;
            display: flex;
        }

        .block-item {
            display: flex;
            width: 50%;
            margin-bottom: 0.125rem;
        }

        .item-name {
            width: 1.5rem;
            text-align: right;
            padding-right: 0.125rem;
            line-height: 0.425rem;
            font-size: 0.175rem;
            cursor: default;

            i {
                font-size: 0.225rem;
                color: #f00;
                padding-right: 0.0375rem;
            }
        }

        .item-value {
            flex: 1;

            .el-input input {
                height: 0.425rem;
                line-height: 0.425rem;
            }

            .el-select {
                width: 100%;
            }

            .desc-textarea.el-textarea.is-disabled {
                .el-textarea__inner {
                    height: 100%;
                }
            }
        }

        .happen-address {
            .el-input {
                width: calc(100% - 0.375rem);
            }

            img {
                width: 0.3rem;
                height: 0.3rem;
                margin-left: 0.0625rem;
                cursor: pointer;
                vertical-align: middle;
            }
        }
    }

    .edit-dialog-content {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .map-dialog {
        .el-dialog {
            height: 75%;
            display: flex;
            flex-direction: column;

            .el-dialog__body {
                padding: 0.125rem;
                flex: 1;

                .edit-dialog-content {
                    width: 100%;
                    height: 100%;

                    .map-box {
                        width: 100%;

                        #myMap {
                            height: 100%;
                        }
                    }
                }
            }
        }
    }

    .every-dialog {
        display: flex;
        flex-direction: column;
        margin: 0 !important;
        position: absolute;
        top: 50% !important;
        left: 50%;
        transform: translate(-50%, -50%);
        /*height:600px;*/
        /*max-height:calc(100% - 30px);*/
        /*max-width:calc(100% - 30px);*/
        width: 100%;
        height: 100%;

        .dialog-content {
            display: flex;
            flex-wrap: wrap;
            padding: 0 0.375rem 0.25rem 0.25rem;

            & > div {
                width: 100%;
            }

            .itemABC {
                width: 100%;

                .item-value {
                    display: flex;
                    justify-content: space-between;
                }
            }

            .line-item {
                display: flex;
                flex-direction: row;
                margin-bottom: 0.1875rem;
                width: 100%;

                .item-name {
                    width: 1.5rem;
                    text-align: right;
                    line-height: 0.425rem;
                    padding-right: 0.125rem;

                    i {
                        color: #f00;
                        padding-right: 0.0375rem;
                    }
                }

                .item-value {
                    flex: 1;

                    .el-input, .el-select {
                        width: 100%;
                        height: 0.425rem;
                        line-height: 0.425rem;
                    }
                }

                .depart-industry {
                    max-height: 3.75rem;
                    overflow-y: auto;
                }
            }
        }

        .dialog-footer {
            text-align: center;
        }
    }

    .upload-image {
        .dialog-content {
            padding: 0.125rem 0.375rem;
            overflow: auto;

            & > div {
                max-height: 5.8375rem;
            }

            .el-upload-dragger {
                width: 1.825rem !important;
                height: 1.825rem !important;
            }
        }

        .dialog-footer {
            text-align: center;
        }
    }

    .viewer-container {
        z-index: 9999 !important;
    }

    // 编辑案件——地图标点弹出层呢个样式
    .select-address {
        .el-dialog__body {
            padding: 0.125rem 0.25rem 0.25rem 0.25rem !important;

            .select-address-content {
                display: flex;
                flex-direction: column;
                width: 100%;
                height: 5rem;
                margin-bottom: 0.125rem;

                .now-address {

                }

                #addressMap {
                    flex: 1;
                    border: 0.0125rem solid #ddd;
                }
            }

            .dialog-footer {
                text-align: center;
            }
        }
    }

    .amap-sug-result {
        z-index: 99999 !important;
    }
    .map-switch{
        // border: 1px solid red;
        background: #fff;
        height: 30px;
        display: flex;
        align-items: center;
        padding-left: 5px;
        padding-right: 5px;
        box-shadow: 2px 2px 5px #cccccc;
        border-radius: 3px;
        z-index: 9999;
        .switch-name{
            margin-right: 8px;
        }
    }
</style>
